# Create Index with settings

**URL:** <https://discuss.elastic.co/t/create-index-with-settings/305771>\
**Category:** Elasticsearch\
**Created:** [May 27, 2022, 6:37am UTC](https://discuss.elastic.co/t/create-index-with-settings/305771 "2022-05-27T06:37:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liushida](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@liushida](https://discuss.elastic.co/u/liushida)\
**Post date:** [May 27, 2022, 6:37am UTC](https://discuss.elastic.co/t/create-index-with-settings/305771/1 "2022-05-27T06:37:02Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/b/6b644dd87d2dfdfd65c755ff08ac7558d0a07d45.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/a/5a652c7a316607195e18ce818dea7b9ecff3c4c8.png)

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [May 27, 2022, 12:31pm UTC](https://discuss.elastic.co/t/create-index-with-settings/305771/2 "2022-05-27T12:31:13Z")

</div>

Hi @liushida

Remove the "settings" like this:

```auto
 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);

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 24, 2022, 12:31pm UTC](https://discuss.elastic.co/t/create-index-with-settings/305771/3 "2022-06-24T12:31:30Z")

</div>

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