Hi, I have a question about matching score. Let's ...
# community-help
m
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
k
You can compare the text match score returned for each result across two different searches, one searching category and the other brand.
And re-sort results client side using that.
m
ok so the matching score is reliable when comparing two different collections?
k
Yes it is computed on string similarity so can be used.
m
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.
so for instance "smartphone apple iphone" could be matched as smartphone => category field apple => brand iphone => product name
k
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.
m
great!