Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to narrow down the author choice in Template Generator #197

Closed
twinkietoes-on opened this issue Feb 23, 2024 · 6 comments · Fixed by #237
Closed

Be able to narrow down the author choice in Template Generator #197

twinkietoes-on opened this issue Feb 23, 2024 · 6 comments · Fixed by #237

Comments

@twinkietoes-on
Copy link
Collaborator

https://librivox.org/add_project

When typing in a common surname for the author, or one that is a partial match to a lot of other names, it returns a long list. Example: typing in "Smith" gives you "Grossmith" and every other surname that contains "Smith" somewhere in it, and the list is getting unwieldy. There's no way to narrow it down (for example, you can't type the first/given name to narrow the list).

I don't know the best solution, but we do need a way to narrow down this list for people to find the author to select; otherwise, they'll give up and make a duplicate author.

redrun45 added a commit to redrun45/librivox-catalog that referenced this issue May 1, 2024
Some folks like to search a single box, but others will naturally start
 to fill out all the details, like it's a regular form.

For the form-filling folks, the First Name and Last Name boxes will each
 act  to refine their partner. Enter the last name, then switch to the
 First Name box, and the offered suggestions will all match the Last
 Name you already entered.

Together with the previous commit, fixes LibriVox#197.
@peterjdann
Copy link
Contributor

Seems to me the behaviour we see here would be better if:

  • In a case where the user has specified only an author surname, the results were sorted by first name. This would mean that "Andrew Smith" would be listed in the dropdown before "Austin Smith" (I made up these examples)
  • In a case where the user has specified only an author first name, the results were sorted by author surname. This would mean that "Mary Bolton" was listed before "Mary Boulton" (again, I made this up)

This change would be pretty easy to implement, and while it wouldn't completely solve the OP's problem, it might go some way to allleviating the pain.

@redrun45
Copy link
Collaborator

@peterjdann: Thank you, Peter! I was going to close this ticket now that we have the ability to search using both fields. I didn't want to "mess things up" for people who were used to the current sorting, but this does seem like an improvement to me. I'll see what folks think.

Since names are involved, our search must be fuzzy, so there are plenty of edge cases ("Smith" gives "George Grossmith", "Mary" gives "Bithia Mary" Croker and "Lady Mary" Loyd)... but at first blush, this "opposite field sort" seems best in more situations overall.

@redrun45
Copy link
Collaborator

@peterjdann, let's talk about this a bit more. For convenience, here's that PDF doc with screenshots of what #232 would do.

Seems to me the behaviour we see here would be better if:
In a case where the user has specified only an author surname, the results were sorted by first name

I've probably misread your comment here. I thought you were suggesting to sort primarily by first name, but you were suggesting to add it as a secondary sort column! We definitely should have a secondary sort column, but you've got me thinking of which it should be. 😉

Thanks to your trick with TRIM(), (and a little more confidence in COALESCE() to fix the pseudonym-sorting problem), here's what it might look like if we did what I thought you meant! Please let me know what you think.

When searching by last name, ORDER BY first_name, last_name (compare to first page of screenshots):
Author-Dropdown-AltFieldSort-Last
George Grossmith is in there somewhere, but he's not before Aaron Smith anymore!

Then when searching by first name, ORDER BY last_name, first_name (compare to second page):
Author-Dropdown-AltFieldSort-BothFields
Drat those Fredericks - the Earl and the Reverend! Titles cannot be fully accounted for, no matter what field we sort by. 😆

Same last_name, first_name order, when searching only by first name:
Author-Dropdown-AltFieldSort-First
Adopting your 'Mary' example, consider "Mary Electa Adams" and "Mary Matthews Adams". Is it more useful for them to be sorted primarily by their middle/maiden names (usually part of the first_name field), or by their last names? There are still a lot of edge cases, but I think this gives better results overall.

If you think #232 is better, then I'll show you the pseudonym fix to add to it, and we can present both options. 😉

@peterjdann
Copy link
Contributor

Sorry it's taken me a few days to get to look at this properly. I think the way you've tackled this is far better than my own version. I don't see any value in presenting both options at all.

What is the best way for us to proceed now to get your change implemented? I'd be perfectly happy to have my own pull request aborted/cancelled/deleted (not quite sure how this works) if the easiest way to get this done would be for you to raise a fresh pull request that implements the change whose effects you've illustrated above.

@redrun45
Copy link
Collaborator

Honestly, having two options is good in any case! If you'd like to cancel #232 for now, I have no objections, but we'll at least still have the screenshots. I'll see what other admins think about them, and then I can put up either version (with added pseudonym fix) for technical review. 👍

@peterjdann
Copy link
Contributor

Honestly, having two options is good in any case! If you'd like to cancel #232 for now, I have no objections, but we'll at least still have the screenshots. I'll see what other admins think about them, and then I can put up either version (with added pseudonym fix) for technical review. 👍

I've closed #232. I think you solution is much better!

@redrun45 redrun45 linked a pull request Aug 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants