# Create index in es 5.1.1 on Jave api

**URL:** <https://discuss.elastic.co/t/create-index-in-es-5-1-1-on-jave-api/75449>\
**Category:** Elasticsearch\
**Created:** [February 17, 2017, 8:20am UTC](https://discuss.elastic.co/t/create-index-in-es-5-1-1-on-jave-api/75449 "2017-02-17T08:20:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin7](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@justin7](https://discuss.elastic.co/u/justin7)\
**Post date:** [February 17, 2017, 8:20am UTC](https://discuss.elastic.co/t/create-index-in-es-5-1-1-on-jave-api/75449/1 "2017-02-17T08:20:11Z")

</div>

Question:  
Failed to parse mapping [person]: Root mapping definition has unsupported parameters: [source : {chineseName={search\_analyzer=ik\_smart, analyzer=ik\_max\_word, type=string}}]

```
    public void createMapping() throws IOException {
		try {
			XContentBuilder personBuilder = XContentFactory.jsonBuilder()
					.startObject()
					.startObject(Global.ELASTICSEARCH_TYPE)
					.startObject(Global.ELASTICSEARCH_SOURCE)
					.startObject("chineseName").field("type", "string")
					.field("analyzer", "ik_max_word").field("search_analyzer", "ik_smart")
					.endObject()

					.endObject().endObject().endObject();

			IndicesAdminClient indicesAdminClient = getClient().admin().indices();
			indicesAdminClient.prepareCreate(Global.ELASTICSEARCH_INDEX).setSettings()
					.addMapping(Global.ELASTICSEARCH_TYPE, personBuilder).get();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
```

---

<div class="post-metadata">

**Author:** ![justin7](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@justin7](https://discuss.elastic.co/u/justin7)\
**Post date:** [February 17, 2017, 8:41am UTC](https://discuss.elastic.co/t/create-index-in-es-5-1-1-on-jave-api/75449/2 "2017-02-17T08:41:21Z")

</div>

It goes well when I change "source" to "properties". Is it standard?

---

<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:** [March 17, 2017, 8:41am UTC](https://discuss.elastic.co/t/create-index-in-es-5-1-1-on-jave-api/75449/3 "2017-03-17T08:41:26Z")

</div>

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