Skip to content

Instantly share code, notes, and snippets.

@shaharmor
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save shaharmor/b51a9297337133efab5f to your computer and use it in GitHub Desktop.

Select an option

Save shaharmor/b51a9297337133efab5f to your computer and use it in GitHub Desktop.
Elasticsearch scripts
curl -XPUT localhost:9200/logstash-YYYY.MM.DD/_settings -d '{ "index.cache.query.enable": true }'
curl -XPOST "localhost:9200/logstash-YYYY.MM.DD/_optimize?max_num_segments=1"
# beofre using this script you must install the reindex module from https://github.com/codelibs/elasticsearch-reindexing
# using $ES_HOME/bin/plugin --install org.codelibs/elasticsearch-reindexing/1.7.0
curl -XPOST "localhost:9200/logstash-YYYY.MM.DD/_reindex/logstash-YYYY.MM.DD-old/?wait_for_completion=true"
curl -XDELETE "localhost:9200/logstash-YYYY.MM.DD/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment