Prioritising Email in Collections Using Typesense
TLDR Pankaj had an issue ranking user emails first in a collection. Jason explained how 'sort_by' works and suggested using the new filter-based sorting mechanism, specifically
"sort_by": "_eval(has_email:true):asc,id:desc". Pankaj agreed to try this solution.
Oct 26, 2022 (14 months ago)
my example collection
email id description
i want to rank the result where users with having email are ranked first with id desc
tried doing sort_by
but looks like missing_values is last one to sort so it always like email desc any other ways this can be done ? thanks in advance
You could use the new filter-based sorting mechanism we’ve added in 0.24.0.rcn25 to implement your use case. Something like:
has_emailis a new boolean field you’ll have to create at indexing time to each record
Oct 27, 2022 (14 months ago)
Indexed 3005 threads (79% resolved)
Document Weighting and Sorting Discussion
SamHendley asked how to weight a document based on age and offered a sorting method. Jason clarified the method and suggested an RC for use. SamHendley tested and confirmed the solution. User Kishore Nallan assisted when an error occurred with a new feature.
Troubleshooting Typesense API Sorting Error in Item Collections
Nikhil encountered a sorting error when using Typesense API due to an optional reference field in the items collection schema. Harpreet and Jason helped debug and identified a bug with sorting in general for 2 fields with the first one being the join field, promising a fix in a forthcoming build.
Resolve Facets and Sorting Issues with Typesense
Ethan needed assistance with getting all facet values and sorting results by date using Typesense. Jason provided guidance on how to use Typesense properties to accomplish these tasks, and resolved issues related to specific use-cases provided by Ethan and Rushil.