OpsCanary
data infraelasticsearchPractitioner

Maximize Elasticsearch Indexing Speed: Proven Techniques

5 min read Official DocsApr 28, 2026
Share
PractitionerHands-on experience recommended

In the world of Elasticsearch, indexing speed is crucial for maintaining performance and ensuring timely data availability. Slow indexing can bottleneck your entire application, leading to delays in search results and user dissatisfaction. By tuning specific parameters and employing effective strategies, you can drastically improve your indexing throughput.

Indexing performance hinges on several factors, including sharding and your indexing strategies. One of the most effective methods to boost performance is through bulk requests, which outperform single-document index requests significantly. The optimal size for these bulk requests can vary, so benchmarking is essential. Additionally, the refresh operation, which makes changes visible to search, is costly. By default, Elasticsearch refreshes indices every second, but you can adjust this setting to improve indexing speed. Disabling the refresh interval during bulk operations is a game-changer. For instance, you can set the refresh interval to -1 to disable it temporarily:

JSON
PUT /my-index-000001/_settings{
  "index" : {
    "refresh_interval" : "-1"
  }
}

In production, it’s vital to monitor your indexing load. If it exceeds what Elasticsearch can handle, you risk rejecting requests or experiencing overall slowdowns. Be cautious with bulk request sizes, as too large requests can put the cluster under memory pressure. Remember, while force merging can optimize search performance, it’s an expensive operation that should be used judiciously.

Key takeaways

  • Adjust the refresh interval to -1 during bulk operations to maximize indexing speed.
  • Utilize bulk requests instead of single-document requests for better performance.
  • Benchmark to determine the optimal size of bulk requests for your specific workload.
  • Monitor indexing load to prevent bottlenecks and request rejections.
  • Be cautious with force merge operations due to their high cost.

Why it matters

In production, optimizing indexing speed can lead to faster search results and improved user experience. A well-tuned Elasticsearch cluster can handle higher loads without degrading performance.

Code examples

JSON
PUT /my-index-000001/_settings{
  "index" : {
    "refresh_interval" : "-1"
  }
}
JSON
PUT /my-index-000001/_settings{
  "index" : {
    "refresh_interval" : "5s"
  }
}
JSON
POST /my-index-000001/_forcemerge?max_num_segments=5

When NOT to use this

If the indexing load exceeds what Elasticsearch can handle, it may become a bottleneck and start rejecting requests or slowing down overall performance.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.