#community-help

Understanding `text_match_type` Parameter in Query Optimization

TLDR John sought clarity on how text_match_type parameter works in search queries, while incorporating field weights for scoring. Kishore Nallan clarified that linear combination with weights had been considered but proved ineffective.

Powered by Struct AI

1

3
1mo
Solved
Join the chat
Oct 05, 2023 (1 month ago)
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
02:30 PM
Hey, I tried switching text_match_type from the default max_score to max_weight and it seems to improve results for some queries, but I would like to better understand how it works. How does it combine matches on multiple tokens? For example, if you search for "black t-shirt" and we search on color with field weight 10 and product_type with field weight 1, it'll first rank on color=black , but surely the match on product_type must be used for some tie breaking? Sorry if the question is unclear, it's a bit confusing to me 🙂
02:47
John
02:47 PM
I think I found the relevant code which helps me understand. But intuitively I would've thought that the scoring is based on some linear combination of the matches in the fields with the field weights as coefficients. It's that something you've considered and scrapped? Would be interested to hear!
Image 1 for I think I found the relevant code which helps me understand. But intuitively I would've thought that the scoring is based on some linear combination of the matches in the fields with the field weights as coefficients. It's that something you've considered and scrapped? Would be interested to hear!
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:57 PM
Linear combination with weights didn't work. What we arrived is through trial and error which broadly seems to work well across a variety of different use cases.

1