librivox-catalog icon indicating copy to clipboard operation
librivox-catalog copied to clipboard

Keywords search dropdown for Advanced Search

Open peterjdann opened this issue 8 months ago • 17 comments

This pull request proposes: (a) Fixing a bug in the catalog's Advanced Search function that currently results in the generation of an incorrect list of results if a user enters a multiterm keywords entry such as "political fiction" or "french revolution" (b) Adding an autocomplete style dropdown list to the keywords field of the catalog Advanced Search

I believe implementing this dropdown will make it much easier than it is presently for users prepared to try our Advanced Search function to find an audiobook that may match a specific subject or genre interest.

Anyone reviewing this code proposal will notice that the SQL used to populate the keywords dropdown list does a look up of the project_keywords table. The purpose of this lookup is to avoid listing in the keywords dropdown keywords which are, in effect, orphans — that is to say, terms that appear in the keywords table, but are never referenced in the project_keywords table. In the scrubbed database, there are currently 2928 such terms. They can be viewed by running the following SQL against the scrubbed database:

SELECT DISTINCT k.value, k.id FROM keywords k where k.id NOT IN (SELECT DISTINCT pk.keyword_id from project_keywords pk) ORDER BY k.id ASC;

peterjdann avatar Jun 14 '24 06:06 peterjdann