How to implement deflate (best compression)?

don't you have kibana?

from there you can run the PUT api call directly from Dev tool.

If not then run curl command like :

curl -XPUT "http://<your cluster ip or fqdn>:9200/_template/my_template" -H 'Content-Type: application/json' -d'{ "index_patterns": ["*"], "settings": { "index": { "codec": "best_compression" } }, "mappings" : { "_source": { "excludes": [ ] } }}'

once you run the above command all your new indices will have best compression.

If you want to do it for the existing index then you will need to close it first and then change compression setting and then open the index.

something like this:

  1. Close all indices:http://localhost:9200/_all/_close'
  2. Apply best_compression to all curl -XPUT 'http://localhost:9200/_all/_settings' -d '{"index.codec" : "best_compression"}'
  3. Open all indices: curl -XPOST 'http://localhost:9200/_all/_open'