To shrink a shard in elasticsearch we already have a “/old_index/_shrink/new_index” endpoint , which creates a new index with less shards. An example of endpoint request : after this execution you would have two indexes with same number of documents and mappings but with different shards and replicas. Sometimes problem occurs like: Then first run the below request: Verify the documents in new_index , and when you are sure its ok then you can delete the old index by requesting: Github: https://github.com/bazingarj/elasticsearch-shrink-index-shards/tree/master Written by
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners