ForceMerge an index
The Elasticsearch core is based on Lucene, which stores the data in segments on disk. During the life of an index, a lot of segments are created and changed. With the increase of segment number, the speed of search is decreased due to the time required to read all of them. The ForceMerge operation allows us to consolidate the index for faster search performance and reducing segments.
Getting ready
You need an up-and-running Elasticsearch installation, as used in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
To execute curl
via the command line, you need to install curl
for your operative system.
To correctly execute the following commands, use the index created in the Creating an index recipe.
How to do it...
The HTTP method used is POST
. The URL format for optimizing one or more indices, is:
http://<server>/<index_name(s)>/_flush[?refresh=True]
The URL format for optimizing all the indices in a cluster, is:
http://<server...