Create custom analyzer in index template

For anyone interested my full completed example is here: Changing the analyzer type fields are no longer aggregatable