teamtnt / laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch
MIT License
1.09k stars 142 forks source link

When search term is part of different words in the index wordlist, only first matching is returned #336

Open mk-conn opened 2 years ago

mk-conn commented 2 years ago

Hey,

Lets have a look at this case:

Only search results for 'java' are returned because TNTSearch::getWordlistByKeyword only returns 'java' because of SELECT * FROM wordlist WHERE term like :keyword ORDER BY length(term) ASC, num_hits DESC LIMIT 1 (l. 308) --> is this by mistake or by intention? In my opinion, when asYouType is enabled the wordlist returned should contain all the words starting with 'java', so the LIMIT 1 could be removed?