Sorting JSON Collection by Specific ID Order
TLDR GM asked how to sort JSON results by specific IDs. Jason suggested using pinned_hits
parameter or sorting results client-side.
May 30, 2023 (4 months ago)
GM
07:11 PMJason
08:12 PMpinned_hits
parameter for this, but you will have to repeat the IDs in both pinned hits and also filter_byJason
08:13 PMfilter_by
parameter, you could then sort the results from Typesense on the client-side using the same sort oderTypesense
Indexed 2786 threads (79% resolved)
Similar Threads
Retrieving Multiple Documents by ID in Typesense
Bruno asked about retrieving multiple documents by ID in Typesense. Jason suggested using `filter_by: id:=` and gave advice on POST requests and order preservation. Bruno successfully implemented these solutions.
Implementing Result Pinning in Typesense Product
Sai questioned about implementing result pinning in Typesense for a product. Kishore Nallan provided several resources and explanations to assist, ultimately suggesting the use of 'sort_by' to promote groups of objects based on an attribute.
Issues Sorting Multiple Fields with Sort_by in Typesense Query
Rishabh was having trouble sorting two fields separately with a single query. Jason explained that a secondary sorting will only occur if the first sort results in matching values. They clarified the functionality of sorting in various search engines.