keymanapp / api.keyman.com

https://api.keyman.com/ source
3 stars 3 forks source link

bug: stop words prevent some keyboards searches from returning results #178

Open mcdurdin opened 1 year ago

mcdurdin commented 1 year ago

One thing I noticed: if I search for the keyboard on keyman, there are zero search results if I include more than one word. Let me show you what I mean. The search results for just the first word: https://keyman.com/keyboards?q=aleph The search results for the first two words: https://keyman.com/keyboards?q=aleph%20with Can this be fixed?

This turns out to be an oddity in SQL Server Full Text Search which we haven't struck with other keyboards. 'With' is a 'stop word', and so it gets ignored in a phrase search. This does feel a little broken. It's possible to disable stop words; we'll think about doing that.

Originally posted by @mcdurdin in https://github.com/keymanapp/keyboards/issues/2148#issuecomment-1432797713

mcdurdin commented 1 year ago

To fix this, we can disable stop words with:

alter fulltext index on k1.t_keyboard set stoplist = off

But we should verify that we don't end up with other unexpected results. It may be okay, but it means that words like 'a' and 'the' will be part of the search, which would be less than helpful.

An alternative would be to also do a substring match instead of a fulltext match.