ElasticSearch High level API create index with custom settings returns error

I'm trying to create ad index with custom settings as explained here with ElasticSearch 6.3

This is my code:

public CreateIndexResponse createIndex(@NotNull String indexName) throws IOException {
        CreateIndexRequest request = new CreateIndexRequest();
        request.index(indexName);
        Settings.Builder settingsBuilder =
                Settings.builder()
                        .put("settings.analysis.filter.autocomplete_filter.type", "edge_ngram")
                        .put("settings.analysis.filter.autocomplete_filter.min_gram", "1")
                        .put("settings.analysis.filter.autocomplete_filter.max_gram", "10")
                        .put("settings.analysis.analyzer.autocomplete.type", "custom")
                        .put("settings.analysis.analyzer.autocomplete.tokenizer", "standard")
                        .putList("settings.analysis.analyzer.autocomplete.filter", "lowercase", "autocomplete_filter");
        request.settings(settingsBuilder);
        return elasticSearchClient.indices().create(request, RequestOptions.DEFAULT);
    }

I've this exception though:

ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=unknown setting [index.settings.analysis.analyzer.autocomplete.filter] please check that any required plugins are installed, or check the breaking changes documentation for removed settings]]

I'm using a AWS ElasticSearch instance. I prefer to use the builder rather than plain JSON to create my settings request. Am I doing something wrong?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.