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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners