# org.elasticsearch.client.ResponseException while creating index

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 6, 2023, 12:48pm UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706 "2023-05-06T12:48:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keerthy\_Ar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keerthy_ar/32/118290_2.png) [@Keerthy\_Ar](https://discuss.elastic.co/u/Keerthy_Ar)\
**Post date:** [May 6, 2023, 12:48pm UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706/1 "2023-05-06T12:48:36Z")

</div>

I am trying to create index with High Rest Client, version 7.17.10  
String mappingSource = "{"mappings":{"properties":{"name":{"type":"text"},"age":{"type":"integer"}}}}";  
CreateIndexRequest request = new CreateIndexRequest("user-test-demo");  
request.source(mappingSource, XContentType.JSON);  
CreateIndexResponse createIndexResponse = elasticsearchClient.indices().create(request, RequestOptions.DEFAULT);

The exception I am receiving:  
Elasticsearch exception [type=illegal\_argument\_exception, reason=request [/user-test-demo] contains unrecognized parameter: [include\_type\_name]]

org.elasticsearch.client.ResponseException: method [PUT], host [[http://localhost:9200](http://localhost:9200)], URI [/user-test-demo?master\_timeout=30s&include\_type\_name=true&timeout=30s], status line [HTTP/1.1 400 Bad Request]

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 6, 2023, 3:03pm UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706/2 "2023-05-06T15:03:32Z")

</div>

What is the version of the server and the version of the client?

BTW, you should use the latest Java client instead.

---

<div class="post-metadata">

**Author:** ![Keerthy\_Ar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keerthy_ar/32/118290_2.png) [@Keerthy\_Ar](https://discuss.elastic.co/u/Keerthy_Ar)\
**Post date:** [May 6, 2023, 4:08pm UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706/3 "2023-05-06T16:08:12Z")

</div>

The Elasticsearch server version I am using is 8.7.0 and the Elasticsearch REST High-Level Client version is 7.17.0.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 6, 2023, 7:37pm UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706/4 "2023-05-06T19:37:56Z")

</div>

So switch to the new client and use the same version for both client and server.

---

<div class="post-metadata">

**Author:** ![Keerthy\_Ar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keerthy_ar/32/118290_2.png) [@Keerthy\_Ar](https://discuss.elastic.co/u/Keerthy_Ar)\
**Post date:** [May 7, 2023, 10:46am UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706/5 "2023-05-07T10:46:25Z")

</div>

May I know, which is the stable version?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 7, 2023, 6:45pm UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706/6 "2023-05-07T18:45:43Z")

</div>

8.7.2 I believe.

---

<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 4, 2023, 6:46pm UTC](https://discuss.elastic.co/t/org-elasticsearch-client-responseexception-while-creating-index/332706/7 "2023-06-04T18:46:13Z")

</div>

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