Fanis Tharropoulos
04/02/2025, 7:25 AMsort_by
fields are tie-breaking, meaning that each one is going to be applied if there are two or more documents with the same value on that sort field.
You could look into using the _eval
clause to sort based on filter conditions:
https://typesense.org/docs/guide/ranking-and-relevance.html#ranking-based-on-conditions
Or just have one popularity / aggregated score field based on that order you mentioned, at indexing time. No need to copy the data to another collection and JOIN for this