# What is different with Json and XContentBuilder,how to use it is currectly?

**URL:** <https://discuss.elastic.co/t/what-is-different-with-json-and-xcontentbuilder-how-to-use-it-is-currectly/177885>\
**Category:** Elasticsearch\
**Created:** [April 22, 2019, 5:12pm UTC](https://discuss.elastic.co/t/what-is-different-with-json-and-xcontentbuilder-how-to-use-it-is-currectly/177885 "2019-04-22T17:12:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChenSijia](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@ChenSijia](https://discuss.elastic.co/u/ChenSijia)\
**Post date:** [April 22, 2019, 5:12pm UTC](https://discuss.elastic.co/t/what-is-different-with-json-and-xcontentbuilder-how-to-use-it-is-currectly/177885/1 "2019-04-22T17:12:57Z")

</div>

First, I set mapping use kibana like this:  
`PUT location { "mappings": { "city": { "properties": { "city":{ "type": "text" }, "polygon":{ "type":"geo_shape" }, "time": { "type": "date" } } } } }`

[git@github.com](mailto:git@github.com):SenalChen/esDemo.git  
Then I got some exception.I don't know how to put a Object into elasticsearch.I must save some "polygon" to do some intersect.  
Is this means type is changed when some Object to Json, and how can I do it with an Java POJO?

---

<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 20, 2019, 5:12pm UTC](https://discuss.elastic.co/t/what-is-different-with-json-and-xcontentbuilder-how-to-use-it-is-currectly/177885/2 "2019-05-20T17:12:59Z")

</div>

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