Typesense Advanced Search Result Capping Issue and Potential Solutions.
TLDR David raised an issue with Typesense advanced search results capping at 250 items per page which excludes intersecting higher results. David suggests either increasing the limit or running intersection serverside. Kishore Nallan agrees to consider both proposals.
Oct 17, 2023 (1 month ago)
David
03:35 PMTo do advanced search (logic against multiple fields) we accept a number of fields to issue a multi search across (eg: name=David, company=Typesense), emit the multisearch for non-null fields, and then find the intersection of the returned result sets.
However the result sets are capped at 250 items per page, and so it's possible that one set is >250 and there is an intersection at result 251 or higher with one of the other result sets below result 250. For example, we match highly on one document on name and it is #1 in the name search, but it is a lower match on the company and it is result 251, we would exclude this document unless we page through all the searches. Our collections are relatively large (60k+) and we're worried that there would, in effect, be hundreds of pages that we'd have to scan.
Is there any recommendation for handling this? Right now we just show a warning that "Too many results returned, try narrowing your search" but this is far from ideal.
David
03:52 PMKishore Nallan
04:21 PMDavid
04:25 PMThe most ideal solution would be to run the intersection serverside before sorting, since we are only interested in the intersection of the multisearch and don't need to spend any computing time sorting results that will be filtered out client side
David
04:25 PMKishore Nallan
04:35 PMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
Increase Search Result Size and Filter Special Characters
Anton requested pagination beyond 250 hits per page and precise filtering for terms with special characters. Jason suggested multi-search as a workaround and planned to address special character filtering in an upcoming release. A Github issue was created to track this feature request.
Moving from Algolia to Typesense: Questions and Answers
Juan sought advice from Kishore Nallan about moving from Algolia to Typesense, handling MultiSearch, setting parameters, checking imported documents, and a specific syntax query.
Merging Results of Multi-Search Queries: Workarounds and Future Features
Julian wanted to merge results from two similar collections. Kishore Nallan confirmed it's a feature that might be implemented but hasn't been prioritised. Both Julian and robert plan to use client-side solutions for now.