I’m trying to build an autocomplete feature using manticore and have the following issue using the “CALL KEYWORDS” approach found in the documentation. In the database are cars and car parts, for example “Mini Cooper” and “BMW 326”.
- The first word works fine and is usable that way
- The second word does not seem consider the first word in any was
- If the first word is “BMW” I will still get the suggestion “Cooper”: CALL KEYWORDS(‘BMW C*’, ‘myindex’, ‘hits’ as sort_mode)
- If the first word is “Mini” I will still get the suggestion “326”: CALL KEYWORDS(‘Mini 3*’, ‘myindex’, ‘hits’ as sort_mode)
Obviously when using one of the two autocomplete results (“BMW Cooper” or “Mini 326”) the user will get no result at all, which makes those autocomplete suggestions very confusing. Why suggest a search term that will not give any results? That’s pretty much useless for anything beyond the fist word.
Is there any way to get the desired behavior: suggest the next word only using documents that include the previous word(s)?