Indexing optimization guide

A short checklist of the settings and habits that make indexing faster in Meilisearch, and the one change most people get wrong.

Carolina Ferreira

Carolina Ferreira

Developer Advocate @ Meilisearch·@CarolainFG

··4 min read
Indexing optimization guide

Share the article

Adding documents to Meilisearch taking longer than expected? This is the short checklist. Each item below is a setting or habit that measurably changes how long indexing takes, ordered roughly by how much difference it makes.

This is the quick version. For the reasoning behind these recommendations and how indexing works under the hood, read indexing best practices.

Configure your index before adding documents

This is the single biggest win, and the one most people miss. Several settings trigger a full reindex of every document in the index when you change them. Change them after loading a large dataset and you pay the indexing cost twice.

The settings that force a full reindex are searchable attributes, filterable attributes, sortable attributes, stop words, synonyms, typo tolerance, embedder configuration, dictionary, proximity precision, and separator and non-separator tokens.

So configure the index first, then add your documents.

Changing displayed attributes or ranking rules does not trigger a reindex. You can tune those freely on a populated index.

Trim your searchable attributes

By default every field in your documents is searchable. The fewer fields Meilisearch has to index, the faster it finishes and the less disk it uses.

Review the searchable attributes list and keep only the fields you actually want matched against query words.

Keep filter-only and sort-only fields out of searchable attributes

Some fields matter for filtering and sorting but should never be matched against query text. Numeric and boolean fields usually fall into this category: a price or an inStock flag is worth filtering on and worthless to full-text search.

Declaring a field filterable or sortable does not make it searchable, so remove those fields from the searchable list.

Send bigger payloads, not more of them

One large HTTP payload indexes faster than several small ones. Adding 100,000 documents as two batches of 50,000 is quicker than four batches of 25,000.

The default maximum payload size is 100MB, and you can raise it if you self-host. Bear in mind that larger payloads use more RAM, and an instance can crash if it needs more memory than the machine has.

Optimize document size

Smaller documents are processed faster, so strip data you do not need. If a field appears in none of your searchable, filterable, sortable, or displayed attributes, it probably does not belong in the document at all.

Beyond that, compress the request body with br, deflate, or gzip. See the supported encoding formats.

Do not use Meilisearch as your primary database

Meilisearch is built for retrieval, not for storage. Every document you add makes indexing and search a little slower, so index only what you need to return in search results and keep the rest in your system of record.

Keep up with the latest stable version

Indexing performance improves release to release, often substantially. Track the Meilisearch releases and update regularly.

On Meilisearch Cloud updates are applied for you, so you get those improvements without scheduling a migration or taking the instance down yourself.

Conclusion

Most slow indexing traces back to one of two things: settings changed after the data was loaded, or far more fields being indexed than the application actually searches. Fix those two and the rest is tuning.

If you have questions, join us on Discord. You can also follow along with our roadmap and take part in product discussions, or subscribe to the newsletter.

Frequently asked questions (FAQs)

Which Meilisearch settings trigger a full reindex?

Searchable attributes, filterable attributes, sortable attributes, stop words, synonyms, typo tolerance, embedder configuration, dictionary, proximity precision, and separator and non-separator tokens. Changing any of these reindexes every document in the index, which is why you should configure them before loading data. Displayed attributes and ranking rules do not trigger a reindex.

Does adding filterable attributes slow down indexing?

Yes. Each filterable or sortable attribute is extra work at indexing time, and changing the list reindexes the whole dataset. Declare the ones your application genuinely filters or sorts on, and no more.

Is it faster to add documents in one big batch or many small ones?

One big batch. A single large HTTP payload is processed faster than several smaller ones, so prefer fewer, larger requests. The tradeoff is memory: bigger payloads need more RAM, and the default payload limit is 100MB.

Why is my indexing slow even after tuning the settings?

The usual remaining causes are disk I/O limits imposed by your cloud provider, an instance too small for the dataset, or documents carrying fields that are never searched, filtered, sorted, or displayed. Indexing is I/O heavy, so throttled volumes hurt it disproportionately.

Carolina Ferreira

Carolina Ferreira

Developer Advocate @ Meilisearch

Carolina joined Meilisearch in 2020 as a Developer Advocate. With a background in translation and teaching, she discovered programming by chance and quickly became passionate about it. She has worked in DevRel and tech support and is now transitioning into a Solution Engineer role, enjoying the diverse challenges along the way. Outside of work, she loves staying active, music, cinema, traveling, and exploring new cuisines—one of her favorite parts of any trip.

Related articles