librivox-catalog
librivox-catalog copied to clipboard
[DNM] Fix advanced language search for compilations
Status of this PR:
- In terms of code, if somebody has time to check for issues which I might have overlooked out of ignorance, that would be welcome. Otherwise, this at least makes for a good update on what I've been learning so far...
- In terms of "do we want this", I've got enough question marks, that I should touch base with other admins before going much further.
Continuing discussion from #12.
The earlier proposed change would indeed hide Sections from the search results, where they were part of a mono-lingual compilation Project. The Project itself would ideally be a single result, rather than a scattering of individual Sections.
This makes perfect sense, unless we're searching by a detail that is specific to each Section. For example, even if our search is an exact match for a Section's title, that Section will still be hidden. And since the Project title will not match that search, we'll get no results at all.
One approach:
I know there is a special Project <-> Group relation, where searching for the title of a Project (e.g. "The Tower Treasure") will make the relevant Group ("The Hardy Boys") show up in the results. You can see the mechanism for this in application/controllers/cron/Search_table_update.php
.
That would work, as far as I can see, but it comes with both technical and usability trade-offs - more entries in the search table, and less visibility into "what is this thing, and why is it in my results for this particular search?"
Instead: Here, I've set up @rillig's change to apply only when we are not searching by title. We could extend this exception for searches by author and by reader, as are also Section-specific. That would come with some edge-case false positives... which we also have in master, so why not? I digress.
I'm now wondering if we wouldn't rather leave the Advanced Search as it is, and instead apply a change like this to the Browse by Language and/or Simple Search features. If other admins have the same thought, then I'll likely approach that with fresh eyes in a week or three. I'm tapped out on this for the moment. 😪
Happy to hear any opinions! I'll get back to them when ready.