> ## 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.

# Your first search

> Perform your first full-text search query in Meilisearch and understand the response format.

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](https://www.meilisearch.com/docs/capabilities/indexing/getting_started.md) first.

## Perform a search

Send a search request to your index with the `q` parameter:

```bash theme={null}
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:

```json theme={null}
{
  "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":

```bash theme={null}
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](https://www.meilisearch.com/docs/capabilities/full_text_search/relevancy/typo_tolerance_settings.md) 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:

```bash theme={null}
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](https://www.meilisearch.com/docs/capabilities/full_text_search/how_to/use_matching_strategy.md).

## Limit and paginate results

Control how many results you get back with `limit` and `offset`:

```bash theme={null}
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

> [card] [Highlight results](https://www.meilisearch.com/docs/capabilities/full_text_search/how_to/highlight_search_results.md)
>
> Show users where their query matched in each result

> [card] [Phrase search](https://www.meilisearch.com/docs/capabilities/full_text_search/getting_started/phrase_search.md)
>
> Search for exact phrases with quotes

> [card] [Add filters](https://www.meilisearch.com/docs/capabilities/filtering_sorting_faceting/getting_started.md)
>
> Narrow results with filters and sorting

> [card] [Relevancy](https://www.meilisearch.com/docs/capabilities/full_text_search/relevancy/relevancy.md)
>
> Understand and customize how results are ranked


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.