Hello! I have a question about creating a custom c...
# community-help
n
Hello! I have a question about creating a custom composite score... I want to do something like
&sort_by=(5*_text_match + 3*popularity - length(title)):desc
where it will dynamically factor in each facet. How might this be accomplished without having to precompute all documents, or postprocessing results?
j
This is not possible in Typesense in the way you described. Instead, if you want to take popularity and length of the title into account, you would have to use those two as variables in a formula and precompute that value for each document and set it an indexing time, and then you can use mix the text match score with your weighted score using bucketing: https://typesense.org/docs/guide/ranking-and-relevance.html#ranking-based-on-relevance-and-popularity
n
ok, thank you for the reply!
👍 1