# Strange behaviour of custom mapping.. Need guidance

**URL:** <https://discuss.elastic.co/t/strange-behaviour-of-custom-mapping-need-guidance/15565>\
**Category:** Elasticsearch\
**Created:** [February 3, 2014, 6:40pm UTC](https://discuss.elastic.co/t/strange-behaviour-of-custom-mapping-need-guidance/15565 "2014-02-03T18:40:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharvi\_Dixit\_2](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@Bharvi\_Dixit\_2](https://discuss.elastic.co/u/Bharvi_Dixit_2)\
**Post date:** [February 3, 2014, 6:40pm UTC](https://discuss.elastic.co/t/strange-behaviour-of-custom-mapping-need-guidance/15565/1 "2014-02-03T18:40:26Z")

</div>

Hi all,

I have created mapping according to my domain data. And using unique id  
from one of the field from the source by setting path of \_id="name of the  
field to be used".  
When i post the data in json format through curl command the id is  
generated from the source but when i insert the data through java program,  
id is generated randomly and not gets chosen fusing the path from source.

the other thing is i have defined a field as string type but when i pass an  
integer data to it elasticsearch stores it in integer format without giving  
any exception ☹  
What can i do..??

Thanks in advance,  
Bharvi Dixit

--  
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/4857b82e-4b7d-41b7-8fe2-3abcac79b30a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4857b82e-4b7d-41b7-8fe2-3abcac79b30a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 6, 2014, 8:19am UTC](https://discuss.elastic.co/t/strange-behaviour-of-custom-mapping-need-guidance/15565/2 "2014-02-06T08:19:45Z")

</div>

Hey,

can you create a gist with the curl example and the java code, so we can  
take a look? Maybe there is a glitch in the code, maybe there is a bug,  
having an example for this would be great. See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Thanks a lot!

--Alex

On Mon, Feb 3, 2014 at 7:40 PM, Bharvi Dixit [bharvidixit@gmail.com](mailto:bharvidixit@gmail.com) wrote:

> Hi all,
> 
> I have created mapping according to my domain data. And using unique id  
> from one of the field from the source by setting path of \_id="name of the  
> field to be used".  
> When i post the data in json format through curl command the id is  
> generated from the source but when i insert the data through java program,  
> id is generated randomly and not gets chosen fusing the path from source.
> 
> the other thing is i have defined a field as string type but when i pass  
> an integer data to it elasticsearch stores it in integer format without  
> giving any exception ☹  
> What can i do..??
> 
> Thanks in advance,  
> Bharvi Dixit
> 
> --  
> 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/4857b82e-4b7d-41b7-8fe2-3abcac79b30a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4857b82e-4b7d-41b7-8fe2-3abcac79b30a%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAGCwEM8eG%3Dx569oQ\_5\_zczG6kk3RNAsC-PoBWeh5-QihbEZ9TA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8eG%3Dx569oQ_5_zczG6kk3RNAsC-PoBWeh5-QihbEZ9TA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:52am UTC](https://discuss.elastic.co/t/strange-behaviour-of-custom-mapping-need-guidance/15565/3 "2017-07-06T01:52:11Z")

</div>


