Documentation 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.
Full-text search is the core feature of Meilisearch. Once you have documents in an index, you can search them with a simple query and get relevant results in milliseconds.
If you haven’t added documents yet, follow the indexing getting started guide first.
Send a search request to your index with the q parameter:
curl -X POST 'MEILISEARCH_URL/indexes/movies/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MEILISEARCH_KEY' \
--data-binary '{
"q": "galaxy"
}'
Meilisearch returns a JSON response with matching documents:
{
"hits": [
{
"id": 24,
"title": "Guardians of the Galaxy",
"overview": "A group of intergalactic criminals are forced to work together...",
"genres": ["Action", "Science Fiction"]
},
{
"id": 25,
"title": "The Hitchhiker's Guide to the Galaxy",
"overview": "Mere seconds before the Earth is to be demolished...",
"genres": ["Adventure", "Comedy", "Science Fiction"]
}
],
"query": "galaxy",
"processingTimeMs": 1,
"limit": 20,
"offset": 0,
"estimatedTotalHits": 2
}
Understanding the response
| Field | Description |
|---|
hits | Array of matching documents, ordered by relevance |
query | The search query you sent |
processingTimeMs | How long the search took in milliseconds |
limit | Maximum number of results returned (default: 20) |
offset | Number of results skipped (for pagination) |
estimatedTotalHits | Estimated total number of matching documents |
Search with typos
Meilisearch handles typos automatically. A search for “galxy” or “galaxi” still returns results for “galaxy”:
curl -X POST 'MEILISEARCH_URL/indexes/movies/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MEILISEARCH_KEY' \
--data-binary '{
"q": "galxy"
}'
This works because Meilisearch uses typo tolerance to match words even when they contain spelling mistakes.
Search with multiple words
When you search with multiple words, Meilisearch finds documents containing any of those words and ranks them by how many words match:
curl -X POST 'MEILISEARCH_URL/indexes/movies/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MEILISEARCH_KEY' \
--data-binary '{
"q": "dark knight"
}'
Documents containing both “dark” and “knight” rank higher than documents containing only one of those words. You can control this behavior with the matching strategy.
Limit and paginate results
Control how many results you get back with limit and offset:
curl -X POST 'MEILISEARCH_URL/indexes/movies/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer MEILISEARCH_KEY' \
--data-binary '{
"q": "action",
"limit": 5,
"offset": 10
}'
This returns 5 results starting from the 11th match.
Next steps
Highlight results
Show users where their query matched in each result
Phrase search
Search for exact phrases with quotes
Add filters
Narrow results with filters and sorting
Relevancy
Understand and customize how results are ranked