Create Index with settings

When I create the index with settings, the response is [es/indices.create] failed: [illegal_argument_exception] unknown setting [index.settings.analysis.analyzer.custom.type]
so how I should resolve this problem?
the ES version is 8.2.0
the JDK version is 17


Hi @liushida

Remove the "settings" like this:

 Reader queryJson = new StringReader(
        "{\n"
            + "    \"analysis\": {\n"
            + "      \"analyzer\": {\n"
            + "        \"custom\": {\n"
            + "          \"type\": \"custom\",\n"
            + "          \"tokenizer\": \"standard\"\n"
            + "        }\n"
            + "      }\n"
            + "    }\n"
            + "}");

    var createIndexRequest = new Builder().index("books")
        .settings(new IndexSettings.Builder().withJson(queryJson).build()).build();
    var result = client.indices().create(createIndexRequest).acknowledged();
    System.out.println(result);

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