# Create index with index-settings

**URL:** <https://discuss.elastic.co/t/create-index-with-index-settings/305161>\
**Category:** Elasticsearch\
**Created:** [May 19, 2022, 9:58am UTC](https://discuss.elastic.co/t/create-index-with-index-settings/305161 "2022-05-19T09:58:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Ott](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_ott/32/105905_2.png) [@Alexander\_Ott](https://discuss.elastic.co/u/Alexander_Ott)\
**Post date:** [May 19, 2022, 9:58am UTC](https://discuss.elastic.co/t/create-index-with-index-settings/305161/1 "2022-05-19T09:58:30Z")

</div>

We are trying to migrate from Elasticsearch 6.7.1 to Elasticsearch 8.2.0.  
In Elasticsearch 6.7.1 it was possible to provide index-settings within an CreateIndexRequest as follows

```auto
{
    "index": {
      "mapping": {
        "total_fields": {
          "limit": 4000
        }
      }
    }
}

```

In Elasticsearch 8.2.0 it produces the following error

```auto
Exception in thread "main" co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch.indices.IndexSettings: Unknown field 'mapping' (JSON path: index.mapping) (line no=3, column no=16, offset=34)
	at co.elastic.clients.json.ObjectDeserializer.parseUnknownField(ObjectDeserializer.java:221)
	at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:178)
	at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:136)
	at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:75)
	at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:79)
	at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
	at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:71)
	at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:180)
	at co.elastic.clients.util.WithJsonObjectBuilderBase.withJson(WithJsonObjectBuilderBase.java:66)
	at co.elastic.clients.json.WithJson.withJson(WithJson.java:57)

```

As workaround i tried to set the _index.mapping.total\_fields.limit_ via the JAVA API Client via

```auto
builder.mappings( m -> m.totalFields( totalFields -> totalFields.limit( 4000 ) ));

```

but it also produces an error

```auto
co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/indices.create] failed: [illegal_argument_exception] unknown setting [index.mappings.total_fields.limit] did you mean any of [index.mapping.total_fields.limit, index.mapping.nested_fields.limit, index.mapping.dimension_fields.limit]?
	at co.elastic.clients.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:281) ~[elasticsearch-java-8.2.0.jar:?]
	at co.elastic.clients.transport.rest_client.RestClientTransport.performRequest(RestClientTransport.java:147) ~[elasticsearch-java-8.2.0.jar:?]
	at co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient.create(ElasticsearchIndicesClient.java:266) ~[elasticsearch-java-8.2.0.jar:?]

```

So how can i set value of _index.mapping.total\_fields.limit_ within an CreateIndexRequest?

---

<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:** [May 19, 2022, 9:58am UTC](https://discuss.elastic.co/t/create-index-with-index-settings/305161/2 "2022-05-19T09:58:30Z")

</div>

Elasticsearch 6.7.1 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Kapobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rodrigo_kapobel/32/105883_2.png) [@Rodrigo\_Kapobel](https://discuss.elastic.co/u/Rodrigo_Kapobel)\
**Post date:** [May 19, 2022, 2:58pm UTC](https://discuss.elastic.co/t/create-index-with-index-settings/305161/3 "2022-05-19T14:58:31Z")

</div>

Hi Alexander! It is happening to me also. It seems clearly to be a bug

---

<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 16, 2022, 2:59pm UTC](https://discuss.elastic.co/t/create-index-with-index-settings/305161/4 "2022-06-16T14:59:07Z")

</div>

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