Migrating from 1.x to 5.x with index settings in the elasticsearch.yml file

I thought I'd post this information for anyone else who may be looking for the solution. I could not otherwise find a solution here or online, and wanted to keep this in the ether.

In our 1.7.x elastic we had configured a default text analyzer of "snowball". However, in 2.4.x and 5.0.x, this is not allowed. When we have hundreds of indexes which are created on the fly, without pre-knowledge they are going to be created, this was a problem.

Use Templates!

You can see here we've created a template called "default" which will apply to all indexes that are created "*" and default to the snowball analyzer. See the templates guide for more settings.

PUT http://localhost:9200/_template/default

{

"template": "*",

"settings": {

"index": { "analysis": { "analyzer": { "default": {"type": "snowball" } } } }

}

}