You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there! I think there is an edge case with combineWith:'AND' where search results are produced incorrectly. It's easier to explain with example then in words, so please bare with me here.
From my perspective combineWith: 'AND' should be applied such that I get the result I am looking for. So it uses AND operator between tokens, but does not use AND operator between terms for the same token. Does it make any sense?
The example here is totally made up. My actual use case is transliteration, where conversion of terms isn't lossless (some letters could disappear) which results in the problem I've described here.
Hi @gyzerok , sorry for the late reply. The issue here is that motorcycle is expanded by the custom processTerm to ['motorcycle', 'bike'], and only one of those matches the indexed document.
I understand you want to support "synonyms", so one can search for "bike" and still find a document containing "motorcycle". One way you can do this is by performing the expansion of synonyms only upon indexing, and not upon search. Something like:
Now, documents including the term "motorcycle" will be indexed as if they also include the term "bike", but search is unaffected, so the issue with AND does not arise. Would this solve your problem?
Activity
lucaong commentedon Sep 14, 2026
Hi @gyzerok , sorry for the late reply. The issue here is that
motorcycleis expanded by the customprocessTermto['motorcycle', 'bike'], and only one of those matches the indexed document.I understand you want to support "synonyms", so one can search for "bike" and still find a document containing "motorcycle". One way you can do this is by performing the expansion of synonyms only upon indexing, and not upon search. Something like:
Now, documents including the term "motorcycle" will be indexed as if they also include the term "bike", but search is unaffected, so the issue with AND does not arise. Would this solve your problem?