#community-help

Typesense Search Query

TLDR Mischa was having issues with a Typesense search query and Jason suggested setting the prefix parameter to false.

Powered by Struct AI

1

5
10mo
Solved
Join the chat
Feb 14, 2023 (10 months ago)
Mischa
Photo of md5-5faa26225a23ba2f1f83f2258d39478c
Mischa
05:01 PM
any idea why these queries give wildly different results? i would expect them to be the same number of records returned
Image 1 for any idea why these queries give wildly different results? i would expect them to be the same number of records returnedImage 2 for any idea why these queries give wildly different results? i would expect them to be the same number of records returned
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:04 PM
Typesense by default does a prefix search on the last word in the search query… When the search query is react python, it’s actually looking for something like this react python*.

And when you do a search for python react it’s searching for python react*.

There are way more results for the latter it looks like, may be matching terms like say python reactive as an example
Mischa
Photo of md5-5faa26225a23ba2f1f83f2258d39478c
Mischa
05:04 PM
how can i search for simply the presence of both terms?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:05 PM
You want to set prefix=false as a search parameter
Mischa
Photo of md5-5faa26225a23ba2f1f83f2258d39478c
Mischa
05:06 PM
thanks!

1