Hi, how do you handle search case such as when sea...
# community-help
j
Hi, how do you handle search case such as when searching for “best thai salmon recipe” and expecting “thai salmon recipe”. I get random results instead.
j
Could you share the exact search request with all the params and the response?
j
Sorry, i used the wrong example. it should be “the thai steamed salmon” and expecting “thai steamed salmon”. I’m having issue with “the” word.
q:"the thai steamed salmon",
query_by: "title"
expecting “red devil eggs”
j
The solve for this would be to exclude stop words like "the" from the query, before sending it to Typesense. This particular demo doesn't filter out stop words, but here's an example of how to filter out stop words: https://github.com/typesense/showcase-books-search/blob/b0b15dc88179566f85db21d2455c2d6c68668d5a/src/app.js#L187
j
Sorry, I forgot to include how to solve this without using the stop word. I don’t think the issue is related to the stop word. If I use “best” or “thai” for e.g.thai Chocolate Crumble and the expecting result should be
Chocolate Crumble
I’m expecting
Chocolate Crumble
to rank higher since it’s in the correct order.
j
Ah I see what you mean...
The dataset doesn't contain any results for "thai chocolate crumble", so Typesense will start dropping keywords from right to left, to attempt to find a match. So it ends up dropping "crumble" and the results you see are actually for "thai chocolate". But in this case, it would have been better to drop "thai" and search for "chocolate crumble" to get better results...
Wondering if we should attempt to drop tokens from the left to right and right to left to solve for this...
j
That make sense, would it possible to add that as an option?
j
Need to think through the implications of doing this. Could you open a Github issue documenting this?
j
Sure
🙏 1
b
Interesting use case
j
@Jason Bosco Do you know if this will be in v.22 build? Thanks
j
@JinW No unfortunately, we're already in feature freeze for v0.22. But the good news is that @Tapasweni Pathak has volunteered to look into this (thank you Tapasweni!)
🙏 1