ElasticSearch: Change index settings after their creation.
Foolish me! I created my indices in #elasticsearch (ES) with wrong analyzers/schema. Unfortunatly, ES does not let me change those online. Alas! I have bazzilions of documents already.
Lo! Help is on its way! With a little help from the excellent #knappsack plugin [1] for ES. It enables me to export everything, a certain index or any type. It can also import those back.
Off we go:
Ensure that ES runs on another port
curl -XPOST es:9900/_export?target=/tmp/all.tar.gz #sure, everything
curl -XDELETE es:9900/_all #DELETE that crap
curl -XPUT 'es:9900/_template/mytemplate' -d '...fancy new template def...' #ref [2]
curl -XPOST es:9900/_import?target=/tmp/all #Reimport the now great crap (yes,
the .tar.gz must not be there)Reconfigure ES to regular port
Nifty!
[1] https://github.com/jprante/elasticsearch-knapsack
[2] http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/