Hey team, is it possible to retrieve a total relev...
# community-help
s
Hey team, is it possible to retrieve a total relevance score instead of the text match score?
I'm overriding the text match sort and I'm seeing higher scores at the bottom of the query results. So I'm curious if there's an internal ranking score I can fetch
_eval(status:active),_text_match:desc
Also is there a range of values to the text match score? I'm seeing numbers in the magnitude of 10^17 (ex.
578730089005449300
) but I'm not sure what the lower and upper bounds are
j
We don't calculate any additional scores besides text relevance score. Results are first scored based on text relevance, and then sorted based on other criteria mentioned in sort_by - these are simple sorts, and don't affect the score.
I'm overriding the text match sort and I'm seeing higher scores at the bottom of the query results.
This is because
_eval(status:active),_text_match:desc
explicitly places active status results on top, ignoring text relevance score. Then within each bucket (1) results that match the filter (2) results that don't match the filter, the value for the
eval
is tied, so then the text match score is used to break the tie. You probably want something like
_text_match(buckets: 10):desc, _eval(status:active)
to achieve what you're looking to do. The bucketing mechanism is described here: https://typesense.org/docs/guide/ranking-and-relevance.html#ranking-based-on-relevance-and-popularity
ty 1
text match score is an int64 value that is bit-packed based on various ranking criteria. So the relative magnitude difference of the value between results doesn't convey any useful information. It's only used for relative ordering
s
Thank you Jason! I see so a query like
_text_match(buckets: 10):desc, _eval(status:active)
would produce results with both active and inactive, ordered by text relevance score
j
Yup
s
Hey Jason, would it be possible to retrieve the score in this
text_match_info
? It would be quite useful knowing the relative difference between results, and further modifying it after processing results. I'm currently querying by
text_match_type:max_weight
I'm mainly looking to assign scores to my results, if fetching the score is not possible do you recommend another method to assign scores to results?
j
The search API response should have that exact field
s
So I'm using the go sdk and
TextMatch  *int64
is the only score I see
j
We might have to add that to the go library to parse from the http response from Typesense. Could you open a github issue in the go sdk repo?
s
Yup will do, just opened an issue
j
We'll look into this this week and keep you posted in the Github issue.
s
Thanks again Jason!
👍 1