aadl / arborelastic

Custom Elasticsearch module for Drupal 8
1 stars 0 forks source link

Improve short words in queries #39

Closed mswinehart closed 6 months ago

mswinehart commented 6 months ago

This addresses the issue of queries composed of multiple short words and queries against titles composed of the same returning poor results. It handles ranking of those items much better when the matches are very close or exact, and it prunes a lot of extraneous stuff that was often showing up. The single multi_match ended up a bit more generous with coincidental prefixes and short words than intended. This adds additional clauses to even that out.

There are comments in the file for the new bits for future reference.

Definitely changes results, so you can decide whether it’s worth putting this out in the lead up to summer game. But it’s active on the dev site for testing & feedback in the meantime. Here are some examples using recent helpdesks.

no mas bebes Before: https://aadl.org/search/catalog/no%20mas%20bebes After: https://dev.aadl.org/search/catalog/no%20mas%20bebes

a to z mysteries Before: https://aadl.org/search/catalog/a%20to%20z%20mysteries After: https://dev.aadl.org/search/catalog/a%20to%20z%20mysteries

plan b lamott Before: https://aadl.org/search/catalog/plan%20b%20lamott After: https://dev.aadl.org/search/catalog/Plan%20b%20lamott

Some previous problem cases are below. All still work, but the results have definitely been trimmed in some cases (for the better I think). Common words like “the” aren’t confusing results anymore.

Breaking free of child(hood) anxiety https://dev.aadl.org/search/catalog/breaking%20free%20of%20childhood%20anxiety

The inside game https://dev.aadl.org/search/catalog/the%20inside%20game

Heaven and earth grocery store https://dev.aadl.org/search/catalog/heaven%20and%20earth%20grocery%20store Critter club volume 11 https://dev.aadl.org/search/catalog/critter%20club%20volume%2011

mswinehart commented 6 months ago

Keeping a running log of how this performs against Steph B's QA expertise

Yoon Ha Lee helpdesk: https://dev.aadl.org/search/catalog/Yoon%20Ha%20Lee

Love times infinity https://dev.aadl.org/search/catalog/Love%20Times%20Infinity

taleon commented 6 months ago

Looks good and SG team approved