#community-help

Comparing Text Match Scores Across Separate Collections

TLDR Maximilian inquired about comparing text matching scores between collections. Kishore Nallan explained that scores are based on string similarity. They acknowledged an issue with scoring inflation and are working on a solution.

Powered by Struct AI
9
19mo
Solved
Join the chat
Mar 30, 2022 (19 months ago)
Maximilian
Photo of md5-d866f36ff951bfe0aae996ac8a2a5024
Maximilian
09:20 AM
Hi, I have a question about matching score. Let's say I have two collections, categories and brands. Is there a way to know in which collection the same word has higher matching score / relevance? Or if I have a collection of products and every product has a category and a brand, is there a way to know in which field the searched word has higher score?
Thanks
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:37 AM
You can compare the text match score returned for each result across two different searches, one searching category and the other brand.
09:38
Kishore Nallan
09:38 AM
And re-sort results client side using that.
Maximilian
Photo of md5-d866f36ff951bfe0aae996ac8a2a5024
Maximilian
09:41 AM
ok so the matching score is reliable when comparing two different collections?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:11 AM
Yes it is computed on string similarity so can be used.
Maximilian
Photo of md5-d866f36ff951bfe0aae996ac8a2a5024
Maximilian
10:17 AM
ok. I see that if I include two fields and the searched text is present on both fields, the score is much higher. So maybe it's better to compare only one field at a time.

When there are more words, it would be very useful to know which word matched what.

If I search for a category and a brand, it would be useful to know if a word is matched as a category or as a brand. At the moment we have the snippet that shows what was matched, but if the word is different (like plurals or a typo) it's impossible to get the matching word.
10:19
Maximilian
10:19 AM
so for instance "smartphone apple iphone" could be matched as
smartphone => category field
apple => brand
iphone => product name
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:40 AM
I'm actually fixing this issue of score inflation caused by the same word matching multiple times, which will help here. I'll have a preview to show next week.
Maximilian
Photo of md5-d866f36ff951bfe0aae996ac8a2a5024
Maximilian
10:43 AM
great!