#community-help

Trouble with Text Match Score Calculation

TLDR Alex experienced issues with text match score results. Jason identified a calculation error, promising a future fix that would ensure the correct match scores and view counts were displayed.

Powered by Struct AI

1

3
32mo
Solved
Join the chat
Mar 20, 2021 (33 months ago)
Alex
Photo of md5-d0775600bad55af89ccb19da7b689e06
Alex
05:29 PM
Hey Jason, thanks for the quick response! So I had considered that, but then my results end up looking like this
1. text_match: 130816, viewCount: 180500, name: 'Luxthos - Shaman'
2. text_match: 196450, viewCount: 169474, name: "Luxthos - Paladin Core"
...
???. text_match: 196451, viewCount: 11, name: "Luxthos Paladin"

Now I have 2 problems
1. The first result technically matches the query, but it's a pretty terrible match. It's like searching for Apple iPad and getting Apple iPhone because it's more popular.
2. The result that matches the text the best will never be seen because it's so far down. Sure, it doesn't have many views, but it would still be nice to show it near the top.
Mar 22, 2021 (32 months ago)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:04 PM
Ah hmm. So I do see one issue in the text match score calculation currently in your original example. Luxthos Paladin and Luxthos - Paladin should have the same match score for the query luxthos paladin - this is something that should be fixed as part of another change we're working on.

Once that's addressed, then with the match score tied between records, then viewCount will be used to break the tie and you'll see viewCount: 169474, name: "Luxthos - Paladin Core" show up as the first result.

I'll let you know when this change is done in an RC build
Alex
Photo of md5-d0775600bad55af89ccb19da7b689e06
Alex
07:17 PM
Awesome, thanks! Definitely not urgent, and I want to say that I'm absolutely loving Typesense.

1