spring-data-elasticsearch - registering custom analyser

I guess you need to remove the field "settings": from json file and put only the content .

Instead of using :

{
"settings": {
    ....
   }
}

Just use :

{ 
"index": {
"number_of_shards": 1,
"analysis": {
  "filter": {
    "autocomplete_filter": {
      "type": "edge_ngram",
      "min_gram": 1,
      "max_gram": 20
    }
  },
  "analyzer": {
    "autocomplete": {
      "type": "custom",
      "tokenizer": "standard",
      "filter": [
        "lowercase",
        "autocomplete_filter"
      ]
     }
    }
   } 
  }
}

Hope it helps you..


Solved

After some research I've discovered the problem was caused by this declaration:

@Bean
public ElasticsearchOperations elasticsearchTemplate(Client client) {
    return new ElasticsearchTemplate(client, new CustomEntityMapper());
}

I removed this declaration and it began get the configuration.