Hi all! Is it possible to make 1 search of differe...
# community-help
a
Hi all! Is it possible to make 1 search of different text_match_type? I want to sort by max_weight, but as a second priority I wanna sort by sum_score. How can I achieve it? So that typesense returns a few scores per document
a
@Aleksei Bochkov, You can search in up 3 fields, separating them by colon
πŸ™ 1
a
Thanks for your response! Just to clarify, you mean
"text_match_type": "max_weight:sum_score"
, right? I have a couple questions about how it works. 1. Is there any difference between
sum_score:max_weight
and
"max_weight:sum_score"
? Doesn’t seem like there is from my testing, but just as a sanity check πŸ˜„ 2. How does scoring work in such case?
f
Hey Aleksei, we have an extensive section about scoring: https://typesense.org/docs/guide/ranking-and-relevance.html#text-match-score-type
a
Thanks @Fanis Tharropoulos! I went through it, it does not say anything about mixing a few search types like
"text_match_type": "max_weight:sum_score"
and how scoring works in such case
f
text_match_type
doesn't support
max_weight:sum_score
. Did you find it mentioned in our documentation?
a
No, just figured out from the comment from @Alan Martini 😞 Ok, got it @Fanis Tharropoulos, is there a way to apply several text match types to 1 query? So that I can kinda calculate different scores and sort results by them
f
They're separate for each query. You could do a federated search using the
/multi_search
API, and use the union parameter to merge the results
πŸš€ 1
a
I apologize @Aleksei Bochkov, I understood sum_score was a custom field of yours.
πŸ™ 1
a
Thank you guys! Love your support ❀️
πŸ™Œ 1