Hello, I get a strange behaviour. I have a collect...
# community-help
m
Hello, I get a strange behaviour. I have a collection of categories that includes the string "_smartphones_". If I search for "_smartphone apple_" Typesense finds the right category. If I search for "_apple smartphone_" it finds something similar to "_apple_" ("_cappe_") but not "_smartphones_". If I set the parameter 'drop_tokens_threshold': 0, "_apple smartphone_" returns 0 results. Is Typesense searching for every word or by phrase? Thanks
k
đź‘‹ Currently Typesense drops tokens from right to left when it can't find a record with all matching words from the query. That's the reason for this difference. However, I'm currently working on an approach that fixes this. I'll have an update in a week.
m
thank you very much! Another question: I'm working with italian language. Is there a way to manage plurals and give them a bigger score instead of considering them "typos"?
k
We don't have a way to do that out of the box, but you can pre-process both the records indexed and the query before sending into Typesense.
m
Using synonyms during import or removing the last letter from the words during search, which would be better?
k
Latter, synonyms not suitable for too many words.
m
ok thanks
m
We are having a similar issue. We are trying to do a search of multiple fields. If we type a single word it works as expected; if the token is found in any field, then it returns the proper documents. But if you type in TWO tokens, Typesense assumes those tokens will be in the same field. If it can’t find them in the same field it then breaks them apart (drops tokens) and treats it as an “OR” search, and returns all documents that contain token 1 OR token 2. We want it to return all documents that contain token 1 AND token 2, regardless of whether they are in the same field. Let me know if you find some workaround. Thanks!
a
Hi @Kishore Nallan is there a GitHub issue for this fix you mentioned?
k
We will be posting updates on https://github.com/typesense/typesense/issues/562 Still working on this.
@Mike Reno Will have something to show next week for this exact issue.
👍 1
m
@Kishore Nallan Great to hear. As a workaround we just added a single string with ALL fields. This generates expected results. The worry is that the amalgamated string could get very large if we start adding all desired fields.
k
Yes, this is not scalable in the long run, which is why we are tackling this so it's fixed once and for all.
@Mike Reno I've published a new Docker build
0.23.0.rc53
that address the cross field matching issue that you noticed. Can you please try that out and let me know?