Elasticsearch force merge

Hi everyone! I have some questions about segments merge in elasticsearch.
Currently, the index I'm trying to merge is a single node index and is about 5GB. But it has 24 segments and some of those segments only contain less than 100 docs.

  1. Is it recommended to force segment merges in this case? What is the recommended max_num_segments? How often should I force merge them?
  2. I tried to force merge by making the index read only first but get FORBIDDEN error. I'm using Elasticsearch 6.6. It seems like I don't need to make it read-only for force merge, which is not the same as the official doc suggested. Any ideas?
curl -X PUT "localhost:9200/log-2019/_settings" -H 'Content-Type: application/json' -d'
"index": { "blocks.read_only": true}
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.