# Is there a way to define mapping in java with a simple string?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-define-mapping-in-java-with-a-simple-string/22907>\
**Category:** Elasticsearch\
**Created:** [March 25, 2015, 8:30pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-define-mapping-in-java-with-a-simple-string/22907 "2015-03-25T20:30:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saipa](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@saipa](https://discuss.elastic.co/u/saipa)\
**Post date:** [March 25, 2015, 8:30pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-define-mapping-in-java-with-a-simple-string/22907/1 "2015-03-25T20:30:52Z")

</div>

Is there a way to simply pass mapping information in a json formatted  
string "{... }" without having to create an object and do a bunch of .put  
on it within Java?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c66a0784-29cc-4a42-958b-d7e189a0b17a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c66a0784-29cc-4a42-958b-d7e189a0b17a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![masaru](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@masaru](https://discuss.elastic.co/u/masaru)\
**Post date:** [March 27, 2015, 2:41am UTC](https://discuss.elastic.co/t/is-there-a-way-to-define-mapping-in-java-with-a-simple-string/22907/2 "2015-03-27T02:41:01Z")

</div>

You can use string. See PutMappingRequest#source(String).

On March 26, 2015 at 05:30:58, Sai Asuka ([asuka.shin@gmail.com](mailto:asuka.shin@gmail.com)) wrote:

## Is there a way to simply pass mapping information in a json formatted string "{... }" without having to create an object and do a bunch of .put on it within Java?

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c66a0784-29cc-4a42-958b-d7e189a0b17a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c66a0784-29cc-4a42-958b-d7e189a0b17a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.5514c379.12200854.166%40citra-2.local](https://groups.google.com/d/msgid/elasticsearch/etPan.5514c379.12200854.166%40citra-2.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:23am UTC](https://discuss.elastic.co/t/is-there-a-way-to-define-mapping-in-java-with-a-simple-string/22907/3 "2017-07-06T00:23:34Z")

</div>

Closed on July 6, 2017, 12:23am UTC


