# Elasticsearch 7.2 CreateIndexRequest mapping questions

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-2-createindexrequest-mapping-questions/205567>\
**Category:** Elasticsearch\
**Created:** [October 29, 2019, 12:26am UTC](https://discuss.elastic.co/t/elasticsearch-7-2-createindexrequest-mapping-questions/205567 "2019-10-29T00:26:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![reo4188](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reo4188/32/56692_2.png) [@reo4188](https://discuss.elastic.co/u/reo4188)\
**Post date:** [October 29, 2019, 12:26am UTC](https://discuss.elastic.co/t/elasticsearch-7-2-createindexrequest-mapping-questions/205567/1 "2019-10-29T00:26:19Z")

</div>

CreateIndexRequest indexRequest = new CreateIndexRequest(indexName);  
indexRequest.settings(Settings.builder().put("index.number\_of\_shards", 1));

String jsonst =  
"{\n " +  
" "properties" : {\n" +  
" "syn": {\n" +  
" "type": "text"\n" +  
" }\n" +  
" }\n" +  
"}";  
indexRequest.mapping(jsonst, XContentType.JSON);  
CreateIndexResponse indexResponse = client.indices().create(indexRequest, RequestOptions.DEFAULT);

- error  
mapping source must be pairs of fieldnames and properties definition.

What is the problem?

---

<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:** [November 26, 2019, 12:26am UTC](https://discuss.elastic.co/t/elasticsearch-7-2-createindexrequest-mapping-questions/205567/2 "2019-11-26T00:26:23Z")

</div>

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