Querying Fields in Random Order in a Collection with Typesense
TLDR Andrew asked if it was possible to query fields in a random order with Typesense. Jason explained that this feature isn't currently available but is being tracked within a GitHub issue and provided a workaround.
Oct 19, 2022 (12 months ago)
Andrew
03:55 PMJason
03:56 PMAndrew
04:09 PMDoes that clarify it better?
Jason
04:11 PMCould you add a comment to that issue with your use case?
In the meantime, let me post a workaround in that issue shortly, so it’s documented for future users.
Jason
04:16 PMTypesense
Indexed 2776 threads (79% resolved)
Similar Threads
Fetching Random Documents Using Random Integer
em1nos inquires about fetching random documents, to which Jason confirms using a random integer is the method. Suggestion for new "random" sort order feature in Typesense was advised to be directed towards Github.
How to Add Random Sort to Typesense Search Results
Fulvio inquired about the possibility of random sorting in Typesense search results. Kishore Nallan suggested a workaround involving geo fields, and Bruno recommended client-side sorting if pagination isn't involved.
Retrieving Random Documents from a Collection
Alexander asked for ways to retrieve random documents from a collection. Jason advised using a random integer field in all records, and filtering using a random numeric range to get the documents.