Querying TypeSense with Different Search String Orders
TLDR Jesper needed explanation on the difference in TypeSense search results for "X Y" and "Y X". Kishore Nallan clarified that Typesense treats the last word as a prefix query, explaining the discrepancy.
Jul 11, 2023 (5 months ago)
We're currently exploring the usability of TypeSense for several new websites we plan to build in 2024. As part of our testing process, we're experimenting with different aspects of the platform.
During my investigation, I came across a specific issue that I haven't been able to find an answer to in the documentation. It's possible that I'm simply not interpreting the documentation correctly.
The problem we've encountered involves a discrepancy in search results when searching for "X Y" versus searching for "Y X". I'm curious about how TypeSense weighs the input of the search string and would like to know where I can find more information on this topic.
Based on my observations, it seems that when there are multiple words in the search query, the second word might even contribute to a negative score.
I appreciate any assistance or guidance you can provide.
Kishore Nallan12:11 PM
X YY is searched as a prefix and in
Y XX is searched as a prefix. This can lead to the results being different. If you don't want this behavior you can set
Indexed 3015 threads (79% resolved)
Typesense Search Query
Mischa was having issues with a Typesense search query and Jason suggested setting the prefix parameter to false.
Resolving Typesense Search Issues
Conversation started by Maximilian about Typesense search behavior led to Users Kishore Nallan and Mike discussing and suggesting workaround, with Kishore Nallan promising an official solution soon. No final confirmation of resolution provided.
Issues with Prefix Search and Sorting Results in Typesense
Pankaj asked about prefix search issues and sorting results in Typesense. Kishore Nallan explained prefix search limitations and suggested using text_match for sorting. Filtering with prefix searching isn't supported.