How it works
When a search query is processed, Meilisearch iterates through documents and ranking rules to find and rank the best matches. On very large datasets (millions of documents) or with broad queries, this process can take significant time. The search cutoff sets an upper bound on this processing time. If Meilisearch reaches the cutoff before finishing, it returns the results collected up to that point. These results are still ranked correctly according to the ranking rules, but the result set may not include every possible match. By default,searchCutoffMs is null. When no explicit value is configured, Meilisearch interrupts searches after 1500 milliseconds. Setting searchCutoffMs to an integer overrides this internal default with your chosen limit.
Check current search cutoff
Retrieve the currentsearchCutoffMs setting for an index:
null.
Set a search cutoff
Configure a maximum search time of 150 milliseconds:Reset search cutoff
Remove the explicit search cutoff and return to the default behavior (searchCutoffMs: null, with Meilisearch’s internal 1500 ms interruption threshold):
Choosing a cutoff value
The right cutoff value is a trade-off: lower values guarantee faster responses but increase the chance of returning incomplete results for broad queries. Higher values give Meilisearch more time to find all matches but allow occasional slow queries. As a general recommendation, avoid setting the cutoff below 500ms. This provides a good safety net against unusually long queries (including potential abuse from crafted search strings) while still giving Meilisearch enough time to return quality results for the vast majority of queries.Search cutoff and remote embedders
If your index uses an embedder that calls an external API at search time, the cutoff also bounds that call. Meilisearch derives the embedding request timeout fromsearchCutoffMs rather than applying a fixed timeout of its own, so the cutoff has to cover the provider round trip on top of the search itself.
This matters when choosing a value:
- A cutoff that is comfortable for keyword search can be too short once a provider round trip is included. A 150 ms cutoff is fine for a purely lexical query and will usually not survive a call to a hosted embedding API.
- If the embedder does not answer in time, the query loses its semantic results. For a pure semantic search, where there are no keyword results to fall back on, the request can fail with an HTTP 500 instead.
searchCutoffMs before looking elsewhere. Embedders that run locally are not affected, since no network call is involved.
Search cutoff vs. other performance optimizations
The search cutoff is a reactive measure that limits query time after it becomes a problem. For proactive performance improvements, consider:- Configuring searchable attributes to reduce the number of fields Meilisearch scans
- Configuring stop words to eliminate common terms from indexing
- Disabling prefix search if search-as-you-type is not needed
For the full API reference, see get search cutoff.