Issues with Typesense Search Results Limit
TLDR Adrian is trying typesense for the first time and encounters an issue with search results being limited to 10 hits. Kishore Nallan suggests sending 'max_candidates: 1000' as a search option.

Mar 01, 2023 (7 months ago)
Adrian
02:54 AM{
name: 'accounts',
fields: [
{
name: 'username',
type: 'string',
facet: false,
},
{
name: 'email',
type: 'string',
facet: false,
},
],
}
And dumped a bunch of random data in there with that structure, if I use this code to search:
const accounts = await typesenseClient
.collections<Omit<Account, 'password'>>('accounts')
.documents()
.search(
{
q: 'Ma',
query_by: 'username',
page: 1,
per_page: 20,
include_fields: 'username',
},
{
cacheSearchResultsForSeconds: 0,
}
);
It will return ONLY 10 hits, even though I know for a fact there should be more documents with the username starting with
Ma
(same thing happens for different searches, it doesn't go over 10) - if the q
param is set to *
it will show all the 1K+ docs available in that collection.What am I missing? I've followed the setup guide from here https://typesense.org/docs/guide/install-typesense.html#linux-binary
Kishore Nallan
03:03 AM
Typesense
Indexed 2764 threads (79% resolved)
Similar Threads
Optimizing Uploads to Typesense and Dealing with Hits Limit
Masahiro asked how to upload documents to Typesense faster and about their search feature limit_hits. Jason suggested batching documents and debugged the search query. Issue was resolved.

Typesense Cloud Search Issue for Large Collections
Anh-Jo encountered search issues in a large collection. Jason identified the `max_candidates` parameter was causing the problem and mentioned the update in `0.24.1` would help.


Typesense Capabilities and Troubleshooting Queries
A had issues with refinement lists and analytics in Typesense. Jason provided a possible solution and recommended the analytics widget. They clarified import size limits and helped identify a filter issue in A's query. Upgrade options are in Typesense's roadmap.

