Retrieving Random Documents from a Collection
TLDR 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.
1
Apr 06, 2022 (21 months ago)
Alexander
04:53 PMJason
04:56 PMAlexander
04:57 PMAlexander
04:58 PMJason
05:00 PMAlexander
05:03 PMAlexander
05:03 PMAlexander
05:14 PM1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Querying Fields in Random Order in a Collection with Typesense
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.
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.
Retrieving All Documents in a Collection with Pagination
ohm was seeking to retrieve all documents of a collection with pagination, without filters. Kishore Nallan suggested a wildcard search.
Deleting All Documents with Filter_by
Mischa wants to delete all documents using `id:*` filter but encounters issues. Jason suggests a workaround and advises creating a GitHub issue for the desired feature.
Random Selection from Typesense Data
John wants to return a random selection from a typesense data set. Kishore Nallan and CaptainCodeman suggest methods, but John still struggles to get the desired result.