#community-help

Querying and Performance in Typesense

TLDR Chris had a problem with a Typesense query not returning a match. Jason solved the issue by suggesting the exhaustive_search feature. Further performance and features of Typesense were also discussed.

Powered by Struct AI

1

1

1

9
3mo
Solved
Join the chat
Jun 30, 2023 (3 months ago)
Chris
Photo of md5-0a1ab11f5c58dd0d83c162474a7e05a8
Chris
12:00 AM
Hi folks, thanks for creating Typesense! I have a qq (more details in 🧵)
12:03
Chris
12:03 AM
I'm running the following query:
{'q': 'quick todos', 'query_by': 'content', 'per_page': 50, 'limit_hits': 50, 'num_typos': 2, 'prefix': 'false'}

One doc indexed into Typesense has the following content: Fast TODOs... (there are also 1-2 other docs that somewhat match this query, but for the sake of this example, I'm focused on the Fast TODOs doc). This doc is not returned as a match. Is this expected behavior? If so, is there any way to make these partial matches get returned in the case of no better match being found?

NOTE: with {'q': 'todos', ...} the doc is returned as expected
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
12:06 AM
Could you check if the solution in this thread helps with your use-case:

https://typesense-community.slack.com/archives/C01P749MET0/p1687882851838579
Chris
Photo of md5-0a1ab11f5c58dd0d83c162474a7e05a8
Chris
12:12 AM
This fixes it, thanks so much!

1

12:13
Chris
12:13 AM
Do you know off the top of your head how this might effect performance on large corpuses?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
12:14 AM
It is definitely more CPU intensive when you turn on exhaustive_search… Hard to give exact numbers because of the number of variables involved. But for let’s say under 500K records the difference shouldn’t be significant.

1

Chris
Photo of md5-0a1ab11f5c58dd0d83c162474a7e05a8
Chris
12:29 AM
Got it, got it, thanks!

Another qq: what's the reasoning for using both exhaustive_search and drop_tokens_threshold? The docs mention that drop_tokens_threshold is ignored if exhaustive_search is turned on
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
12:54 AM
Oh you’re right! I forgot that little detail. So just exhaustive_search: true should suffice

1