Skip to main content
The search cutoff defines the maximum time in milliseconds that Meilisearch spends processing a single search query. When the cutoff is reached, Meilisearch stops searching and returns the best results found so far. This ensures predictable response times on large datasets where some queries might otherwise take too long.

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 current searchCutoffMs setting for an index:
The default response is null.

Set a search cutoff

Configure a maximum search time of 150 milliseconds:
With this configuration, any search query that takes longer than 150ms will be interrupted, and Meilisearch returns the best results found within that time.
Setting the cutoff too low may result in incomplete or empty result sets for broad queries. Start with a value between 100ms and 500ms and adjust based on your performance requirements.

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.
The cutoff is most useful as a safety net, not as a performance tuning knob. If your searches are consistently slow, address the root cause with the optimizations below rather than lowering the cutoff.

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 from searchCutoffMs 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.
So if semantic results go missing, or pure semantic searches start returning HTTP 500, raise searchCutoffMs before looking elsewhere. Embedders that run locally are not affected, since no network call is involved.
Measure your provider’s typical latency first, then set the cutoff above that plus your normal search time. Choosing an embedder covers the trade-offs between hosted and local models.

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: These optimizations reduce the work Meilisearch does during each query, which may eliminate the need for a cutoff entirely.
For the full API reference, see get search cutoff.