# The index creating by ElasticSearch(6.8.8) not match the configuration in code?

**URL:** <https://discuss.elastic.co/t/the-index-creating-by-elasticsearch-6-8-8-not-match-the-configuration-in-code/300651>\
**Category:** Elasticsearch\
**Created:** [March 25, 2022, 1:12am UTC](https://discuss.elastic.co/t/the-index-creating-by-elasticsearch-6-8-8-not-match-the-configuration-in-code/300651 "2022-03-25T01:12:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuekg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xuekg/32/103507_2.png) [@xuekg](https://discuss.elastic.co/u/xuekg)\
**Post date:** [March 25, 2022, 1:12am UTC](https://discuss.elastic.co/t/the-index-creating-by-elasticsearch-6-8-8-not-match-the-configuration-in-code/300651/1 "2022-03-25T01:12:37Z")

</div>

I hava a cluster of ES with 3 servers.  
The version of ES and ik are same 6.8.8.  
Dependency of spring boot:

```auto
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.13.RELEASE</version>

```

```auto
<elasticsearch.version>6.8.13</elasticsearch.version>

```

The configuration in code like this:

```auto
@Document(indexName = "xx", type = "_doc", shards = 3)

```

When the project startup,it will create index auto,whih the configuration before,and there are some logs like this :

```auto
2022-03-24 16:10:40 [WARN] [I/O dispatcher 1] o.e.c.RestClient#logResponse:65 - request [PUT http://xxx:9200/xxx/_mapping/_doc?master_timeout=30s&include_type_name=true&timeout=30s] returned 2 warnings: [299 Elasticsearch-6.8.8-2f4c224 "'y' year should be replaced with 'u'. Use 'y' for year-of-era. Prefix your date format with '8' to use the new specifier."],[299 Elasticsearch-6.8.8-2f4c224 "[types removal] Specifying types in put mapping requests is deprecated. To be compatible with 7.0, the mapping definition should not be nested under the type name, and the parameter include_type_name must be provided and set to false."]

```

also there are logs in ES that can match the configuraton :

```auto
[2022-03-24T16:10:39,991][INFO][o.e.c.m.MetaDataCreateIndexService] [node-35] [xxx] creating index, cause [api], templates [], shards [3]/[1], mappings []
[2022-03-24T16:10:40,187][INFO][o.e.c.m.MetaDataMappingService] [node-35] [xxx/UWWdI8n1RAe1GVbKMQ1oKQ] create_mapping [_doc]
[2022-03-24T16:10:41,336][INFO][o.e.c.r.a.AllocationService] [node-35] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[xxx][1]] ...]).

```

Then I delete all the indices in Kibaba.

In web page of project,I add a data that will trigger the creating of index in code.Then the index ES created with api is wrong,both the setting and mapping.  
Here are the logs :

```auto
[2022-03-24T13:56:58,144][INFO][o.e.c.m.MetaDataCreateIndexService] [node-35] [xxx] creating index, cause [auto(bulk api)], templates [], shards [5]/[1], mappings []
[2022-03-24T13:56:58,314][INFO][o.e.c.m.MetaDataMappingService] [node-35] [xxx/c-WvlLGmTve5yxxQClvP5w] create_mapping [_doc]
[2022-03-24T13:56:58,858][INFO][o.e.c.r.a.AllocationService] [node-35] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[patient][4]] ...]).

```

The one is cause(api) and another is cause(auto(bulk api)).

What should I do?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 28, 2022, 12:05am UTC](https://discuss.elastic.co/t/the-index-creating-by-elasticsearch-6-8-8-not-match-the-configuration-in-code/300651/2 "2022-03-28T00:05:49Z")

</div>

Welcome to our community! 😃

6.8 is [EOL](https://www.elastic.co/support/eol) and no longer supported, you need to upgrade ASAP. Latest is 8.1.

> [@xuekg](#):
>
> In web page of project,I add a data that will trigger the creating of index in code.Then the index ES created with api is wrong,both the setting and mapping.

> [@xuekg](#):
>
> The one is cause(api) and another is cause(auto(bulk api)).

Do they make the same requests to Elasticsearch?

---

<div class="post-metadata">

**Author:** ![xuekg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xuekg/32/103507_2.png) [@xuekg](https://discuss.elastic.co/u/xuekg)\
**Post date:** [March 28, 2022, 11:24am UTC](https://discuss.elastic.co/t/the-index-creating-by-elasticsearch-6-8-8-not-match-the-configuration-in-code/300651/3 "2022-03-28T11:24:10Z")

</div>

tks for your reply.

The requests to Elasticsearch are not the same.  
It's my mistake action.

tks again for u reply.

---

<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:** [April 25, 2022, 11:24am UTC](https://discuss.elastic.co/t/the-index-creating-by-elasticsearch-6-8-8-not-match-the-configuration-in-code/300651/4 "2022-04-25T11:24:49Z")

</div>

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