Prefix search allows Meilisearch to match documents based on the beginning of the last word in a query. For example, typingDocumentation Index
Fetch the complete documentation index at: https://www.meilisearch.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
adv matches “adventure”, “adventure”, and “advanced”. This is the feature that powers the “search as you type” experience.
The prefixSearch index setting controls how Meilisearch handles prefix matching.
Available modes
| Mode | Description |
|---|---|
indexingTime | Default. Prefix data structures are built during indexing. This enables fast prefix search at query time but increases index size and indexing duration. |
disabled | Prefix search is turned off. Only exact word matches are returned. This reduces index size and speeds up indexing, but users must type complete words to find results. |
Check current prefix search setting
Retrieve the currentprefixSearch setting for an index:
"indexingTime".
Disable prefix search
If your use case does not require search-as-you-type (for example, users submit complete queries via a search button), disabling prefix search can reduce index size and improve indexing performance:Reset prefix search
Restore the defaultindexingTime behavior:
When to disable prefix search
- Form-based search: Users type a full query and press a search button rather than seeing results as they type
- Large datasets with performance constraints: Disabling prefix search reduces index size and speeds up both indexing and queries
- Exact matching requirements: When partial word matches would return too many irrelevant results
When to keep prefix search enabled
- Search-as-you-type interfaces: Users expect results to update instantly as they type each character
- Autocomplete experiences: Prefix matching is essential for suggesting completions
- Discovery-oriented search: Partial matches help users explore content they might not find with exact queries
Prefix search only applies to the last word in a multi-word query. Earlier words in the query must match completely (or within typo tolerance). For example, searching for
harry pot matches “Harry Potter” because “harry” matches exactly and “pot” is a prefix match for “Potter”.For the full API reference, see get prefix search.