#community-help

Collection-Level Scoring in Typesense Multi-Search

TLDR Mile questioned the possibility of collection-level scoring in Typesense. Jason advised adjusting scores client-side, and requested Mile to create a GitHub issue to assess community interest.

Powered by Struct AI
Oct 09, 2023 (1 month ago)
Mile
Photo of md5-06e1c6bddf52b9899eb63983d28f325f
Mile
04:21 PM
Hello everyone, I have a question regarding the multi_search done on several collections. I would like to know if there is any way to influence the scoring on the collection level. For example, I have 2 collections, collection A and collection B. If we have an exact match on Field 1 in collection A, this should be ranked higher than an exact match on Field 1 in collection B. Is there a way of doing a cross-collection ranking? I tried using the query_by_weights and so far, I feel that the approach is limited. Note: we query 6-7 collections per multi-search.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:34 PM
Typesense doesn't have a way to do collection-level scoring like that...

You would have to augment the text match score you receive from each multi_search with your own logic on the client-side to weight the scores as needed based on the collection
Oct 10, 2023 (1 month ago)
Mile
Photo of md5-06e1c6bddf52b9899eb63983d28f325f
Mile
09:10 AM
Hi Jason, thanks for the response. Can I ask, if is there a way to get the collection scoring mechanism?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:11 PM
We prioritize features based on popularity and/or if it's sponsored by someone in the community. Could you create a GitHub issue for this, so we can track interest?