Simple Tweaks That Can Make Your Meilisearch Faster

Meilisearch is a really powerful search engine; it’s fast, open-source, and easy to set up.

But if you don’t configure it properly, especially the indexing and attributes, it can start to feel slow.

Let’s say you set up an index with a few thousand records and start running searches. At first, things feel snappy — queries respond in under 20ms, which is very fast.

But then you notice that some searches — especially those with 3 or more keywords — are suddenly taking above 300ms or more, even on a local instance.

Making just a few small tweaks to how you set up your indexes and attributes can significantly improve speed and overall performance.

What Makes Meilisearch Slow?

Have you ever felt like your Meilisearch results are a bit slow? Maybe you’ve had to wait longer than expected for a simple search to load.

In many cases, just tweaking how you index your data can make a huge difference. Small changes, like setting up your searchable and filterable attributes properly or avoiding unnecessary fields, can significantly speed things up.

These little optimizations not only improve performance but also make the whole search experience smoother.

Optimizing Searchable Attributes

When we are working with Meilisearch, it's important to understand which fields in your documents actually need to be searchable.

Sometimes, fields like numeric values or booleans—such as price, age, or isActive—are only used for filtering or sorting and don’t need to be part of the searchable attributes. Including these fields in your searchableAttributes list can slow down indexing and impact search performance unnecessarily.

By removing any non-essential fields from the searchable list, Meilisearch focuses on what really matters for search, leading to faster and more efficient results.

When I didn’t set any searchable attributes, the search took 31ms

"swagath@VictusbyHP":"`~$ time curl -X POST""http://127.0.0.1:7700/indexes/shows/search""-H""Content-Type: application/json""-H""Authorization: Bearer mPGrxPdYtrbGtfQPUMtJfHTyzkkTOtVs6cWXcT4r3-E""--data-raw""{ \"q\": \"Gilbert Chan\" `}"{
   "hits":[
      {
         "Show_Id":"s3",
         "Category":"Movie",
         "Title":"23:59",
         "Director":"Gilbert Chan",
         "Cast":"Tedd Chan, Stella Chung, Henley Hii, Lawrence Koh, Tommy Kuan, Josh Lai, Mark Lee, Susan Leong, Benjamin Lim",
         "Country":"Singapore",
         "Release_Date":"December 20, 2018",
         "Rating":"R",
         "Duration":"78 min",
         "Type":"Horror Movies, International Movies",
         "Description":"When an army recruit is found dead, his fellow soldiers are forced to confront a terrifying secret that's haunting their jungle island training camp."
      },
      {
         "Show_Id":"s7015",
         "Category":"Movie",
         "Title":"The Workshop",
         "Director":"Laurent Cantet",
         "Cast":"Marina Foïs, Matthieu Lucci, Warda Rammach, Issam Talbi, Florian Beaujean, Mamadou Doumbia, Julien Souve, Mélissa Guilbert, Olivier Thouret, Lény Sellam",
         "Country":"France",
         "Release_Date":"November 10, 2018",
         "Rating":"TV-MA",
         "Duration":"114 min",
         "Type":"Dramas, International Movies",
         "Description":"In an old shipyard town in France, sociopolitical tensions beset a writing workshop where the instructor notices a student with a dark side."
      }
   ],
   "query":"Gilbert Chan",
   "processingTimeMs":20,
   "limit":20,
   "offset":0,
   "estimatedTotalHits":14
}real    0m0.031s
user    0m0.004s
sys     0m0.004s

After specifying Director as a searchable attribute, the search time dropped to 10ms

"swagath@VictusbyHP":"~$ time curl -X POST""http://127.0.0.1:7700/indexes/shows/search""-H""Content-Type: application/json""-H""Authorization: Bearer mPGrxPdYtrbGtfQPUMtJfHTyzkkTOtVs6cWXcT4r3-E""--data-raw""{ \"q\": \"Gilbert Chan\" }"{
   "hits":[
      {
         "Show_Id":"s3",
         "Category":"Movie",
         "Title":"23:59",
         "Director":"Gilbert Chan",
         "Cast":"Tedd Chan, Stella Chung, Henley Hii, Lawrence Koh, Tommy Kuan, Josh Lai, Mark Lee, Susan Leong, Benjamin Lim",
         "Country":"Singapore",
         "Release_Date":"December 20, 2018",
         "Rating":"R",
         "Duration":"78 min",
         "Type":"Horror Movies, International Movies",
         "Description":"When an army recruit is found dead, his fellow soldiers are forced to confront a terrifying secret that's haunting their jungle island training camp."
      }
   ],
   "query":"Gilbert Chan",
   "processingTimeMs":0,
   "limit":20,
   "offset":0,
   "estimatedTotalHits":1
}real    0m0.010s
user    0m0.002s
sys     0m0.005s

I initially didn’t set any searchableAttributes, so Meilisearch ended up searching through every field in the document. This made the search slower, around 31ms.

Later, I explicitly set only the Director field as searchable, and the search time dropped to 10ms. By telling Meilisearch exactly where to look, I avoided unnecessary processing and made the search way faster.

Choosing the Right Filterable Attributes

Just like searchable attributes, it's a good idea to be careful with what you add to your filterable attributes in Meilisearch.

It might seem okay to make everything filterable, but that can slow things down and make your index heavier. We only have to add fields that we really plan to use for filtering, like category, status, or isActive. These are the kinds of fields users might select in a filter or dropdown.

I had many fields marked as filterable — everything from Title to Country to Description. When I ran a filtered search using just Show_Id, it took 19ms

"swagath@VictusbyHP":"~$ curl -X GET""http://127.0.0.1:7700/indexes/shows/settings/filterable-attributes""\\
  -H""Authorization: Bearer mPGrxPdYtrbGtfQPUMtJfHTyzkkTOtVs6cWXcT4r3-E"[
   "Show_Id",
   "Category",
   "Title",
   "Director",
   "Cast",
   "Country",
   "Release_Date",
   "Rating",
   "Duration",
   "Type",
   "Description"
]
swagath@VictusbyHP":"~$ time curl -X POST""http://127.0.0.1:7700/indexes/shows/search""-H""Content-Type: application/json""-H""Authorization: Bearer mPGrxPdYtrbGtfQPUMtJfHTyzkkTOtVs6cWXcT4r3-E""--data-raw""{
    \"q\": \"Gilbert Chan\",
    \"filter\": \"Show_Id = \"s3\"\"
  }"{
   "hits":[
      {
         "Show_Id":"s3",
         "Category":"Movie",
         "Title":"23:59",
         "Director":"Gilbert Chan",
         "Cast":"Tedd Chan, Stella Chung, Henley Hii, Lawrence Koh, Tommy Kuan, Josh Lai, Mark Lee, Susan Leong, Benjamin Lim",
         "Country":"Singapore",
         "Release_Date":"December 20, 2018",
         "Rating":"R",
         "Duration":"78 min",
         "Type":"Horror Movies, International Movies",
         "Description":"When an army recruit is found dead, his fellow soldiers are forced to confront a terrifying secret that's haunting their jungle island training camp."
      }
   ],
   "query":"Gilbert Chan",
   "processingTimeMs":0,
   "limit":20,
   "offset":0,
   "estimatedTotalHits":1
}real    0m0.019s
user    0m0.000s
sys     0m0.007s

I only ever needed to filter by Show_Id, so I cleaned up the filterableAttributes and kept only that one field. The search got even faster, down to 10ms.

"swagath@VictusbyHP":"~$ time curl -X POST""http://127.0.0.1:7700/indexes/shows/search""-H""Content-Type: application/json""-H""Authorization: Bearer mPGrxPdYtrbGtfQPUMtJfHTyzkkTOtVs6cWXcT4r3-E""--data-raw""{
    \"q\": \"Gilbert Chan\",
    \"filter\": \"Show_Id = \"s3\"\"
  }"{
   "hits":[
      {
         "Show_Id":"s3",
         "Category":"Movie",
         "Title":"23:59",
         "Director":"Gilbert Chan",
         "Cast":"Tedd Chan, Stella Chung, Henley Hii, Lawrence Koh, Tommy Kuan, Josh Lai, Mark Lee, Susan Leong, Benjamin Lim",
         "Country":"Singapore",
         "Release_Date":"December 20, 2018",
         "Rating":"R",
         "Duration":"78 min",
         "Type":"Horror Movies, International Movies",
         "Description":"When an army recruit is found dead, his fellow soldiers are forced to confront a terrifying secret that's haunting their jungle island training camp."
      }
   ],
   "query":"Gilbert Chan",
   "processingTimeMs":0,
   "limit":20,
   "offset":0,
   "estimatedTotalHits":1
}real    0m0.010s
user    0m0.000s
sys     0m0.008s

If a field isn’t going to be used in filters, it’s better to leave it out. Keeping the filterable list clean helps Meilisearch work faster.

Keep Meilisearch for Searching Only

Meilisearch is built for fast and efficient information retrieval, not for storing your entire dataset like a database. It works best when you index only the documents that you actually need to search.

The more documents you add, the heavier it becomes—indexing takes longer, and search performance can slow down. So, it’s a good idea to keep your index focused.

Flatten Your Data for Better Speed

Are you storing full HTML content or deeply nested objects inside your documents?

If so, that might be slowing your Meilisearch down. These types of fields add unnecessary weight to each document, making indexing heavier and searches less efficient.

Optimizing your Meilisearch index structure can make a big difference in performance. Instead of dumping everything in, try to normalize and flatten your data before indexing.

Keep only what you need for searching and filtering.

Avoid Overload

Fetching too many results at once can slow down your app and put extra load on the server.
In Meilisearch, large search responses mean more work for the CPU and bigger payloads to send over the network.

A simple way to avoid this is by using pagination. By default, Meilisearch returns 20 results per page, which is usually enough for most use cases.

"swagath@VictusbyHP":"~$ time curl -X POST""http://127.0.0.1:7700/indexes/shows/search""-H""Content-Type: application/json""-H""Authorization: Bearer mPGrxPdYtrbGtfQPUMtJfHTyzkkTOtVs6cWXcT4r3-E""--data-raw""{
    \"q\": \"s3\",
    \"limit\": 50
  }"{
   "hits":[
      {
         "Show_Id":"s3",
         "Category":"Movie",
         "Title":"23:59",
         "Director":"Gilbert Chan",
         "Cast":"Tedd Chan, Stella Chung, Henley Hii, Lawrence Koh, Tommy Kuan, Josh Lai, Mark Lee, Susan Leong, Benjamin Lim",
         "Country":"Singapore",
         "Release_Date":"December 20, 2018",
         "Rating":"R",
         "Duration":"78 min",
         "Type":"Horror Movies, International Movies",
         "Description":"When an army recruit is found dead, his fellow soldiers are forced to confront a terrifying secret that's haunting their jungle island training camp."
      },
      
   ],
   "query":"s3",
   "processingTimeMs":1,
   "limit":50,
   "offset":0,
   "estimatedTotalHits":1000
}real    0m0.017s
user    0m0.004s
sys     0m0.005s

After reducing the limit to 10 it took only 10ms.

"swagath@VictusbyHP":"~$ time curl -X POST""http://127.0.0.1:7700/indexes/shows/search""-H""Content-Type: application/json""-H""Authorization: Bearer mPGrxPdYtrbGtfQPUMtJfHTyzkkTOtVs6cWXcT4r3-E""--data-raw""{
    \"q\": \"s3\",
    \"limit\": 10
  }"{
   "hits":[
      {
         "Show_Id":"s3",
         "Category":"Movie",
         "Title":"23:59",
         "Director":"Gilbert Chan",
         "Cast":"Tedd Chan, Stella Chung, Henley Hii, Lawrence Koh, Tommy Kuan, Josh Lai, Mark Lee, Susan Leong, Benjamin Lim",
         "Country":"Singapore",
         "Release_Date":"December 20, 2018",
         "Rating":"R",
         "Duration":"78 min",
         "Type":"Horror Movies, International Movies",
         "Description":"When an army recruit is found dead, his fellow soldiers are forced to confront a terrifying secret that's haunting their jungle island training camp."
      },
      {
         "Show_Id":"s36",
         "Category":"Movie",
         "Title":"#Rucker50",
         "Director":"Robert McCullough Jr.",
         "Cast":"",
         "Country":"United States",
         "Release_Date":"December 1, 2016",
         "Rating":"TV-PG",
         "Duration":"56 min",
         "Type":"Documentaries, Sports Movies",
         "Description":"This documentary celebrates the 50th anniversary of the Harlem sports program that has inspired countless city kids to become pro basketball players."
      },
   ],
   "query":"s3",
   "processingTimeMs":0,
   "limit":10,
   "offset":0,
   "estimatedTotalHits":1000
}real    0m0.010s
user    0m0.003s
sys     0m0.004s

Unless you really need more, it’s better not to increase the limit too much. Keeping the number of results small helps your search stay fast.

Setup your Index First

When you're creating a new index in Meilisearch, it's a good idea to configure the settings before you start adding documents.

Things like searchableAttributes or filterableAttributes—if you tweak these after the data is already in, Meilisearch will need to reindex everything. And yep, that can take a while if your dataset is big.

To save time and avoid that extra work, just get your settings right first, then load your documents.

Optimization Area wihout optimizing with optimizing
Searchable Attributes 31ms 10ms
Filterable Attributes 19ms 10ms
Overloaded Payloads 17ms (limit: 50) 10ms (limit: 10)
Data structure (raw HTML / nested) Heavy Lightweight

Wrapping up

Meilisearch is a powerful tool—but like any tool, it performs best when used correctly.
Over time, I’ve learned that keeping the index lean, focusing only on the necessary searchable and filterable attributes, and avoiding overly complex data structures can lead to significantly better performance.

Configuring things like searchable attributes and filterable fields before indexing goes a long way in keeping everything efficient and smooth.
These aren’t massive changes, but they have a noticeable impact.

LiveAPI: Interactive API Docs that Convert

Static API docs often lose the customer's attention before they try your APIs. With LiveAPI, developers can instantly try your APIs right from the browser, capturing their attention within the first 30 seconds.

1 powerful reason a day nudging you to read
so that you can read more, and level up in life.

Sent throughout the year. Absolutely FREE.