# A quick question about mapping

**URL:** https://discuss.elastic.co/t/a-quick-question-about-mapping/3017
**Category:** Elasticsearch
**Created:** [June 14, 2010, 7:23am UTC](https://discuss.elastic.co/t/a-quick-question-about-mapping/3017 "2010-06-14T07:23:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)
#### Post date: [June 14, 2010, 7:23am UTC](https://discuss.elastic.co/t/a-quick-question-about-mapping/3017/1 "2010-06-14T07:23:09Z")

</div>

Hi,  
I have a quick question about property mapping. I have an intention to  
introduce a double property to an index (with default settings) and index  
and search it. Here is the simple mapping that I use:

{  
"myType" : {  
"properties" : {  
"value" : {"type" : "double"}  
}  
}  
}

When I use java node client to index data, I can insert an java  
integer value to the index, and when I search, I get it as integer  
also. Naturally I can't cast it to double. Is this what should I  
expect from elastic search, does the responsibility belong who uses ES  
clients, or should java search give me double values ?

Thanks in advance,  
Sezgin Kucukkaraaslan  
[www.ifountain.com](http://www.ifountain.com)

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [June 14, 2010, 10:57am UTC](https://discuss.elastic.co/t/a-quick-question-about-mapping/3017/2 "2010-06-14T10:57:49Z")

</div>

What do you use to get it back from search? Do you get the source as map?

-shay.banon

2010/6/14 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)

> Hi,  
> I have a quick question about property mapping. I have an intention to  
> introduce a double property to an index (with default settings) and index  
> and search it. Here is the simple mapping that I use:
> 
> {  
> "myType" : {  
> "properties" : {  
> "value" : {"type" : "double"}
> 
> ```
> }
> }
> 
> ```
> 
> }
> 
> When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from Elasticsearch, does the responsibility belong who uses ES clients, or should java search give me double values ?
> 
> Thanks in advance,  
> Sezgin Kucukkaraaslan  
> [www.ifountain.com](http://www.ifountain.com)

---

<div class="post-metadata">

### Author: ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)
#### Post date: [June 14, 2010, 2:13pm UTC](https://discuss.elastic.co/t/a-quick-question-about-mapping/3017/3 "2010-06-14T14:13:24Z")

</div>

yes, indeed

On Mon, Jun 14, 2010 at 1:57 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> What do you use to get it back from search? Do you get the source as map?
> 
> -shay.banon
> 
> 2010/6/14 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)
> 
> Hi,
> 
> > I have a quick question about property mapping. I have an intention to  
> > introduce a double property to an index (with default settings) and index  
> > and search it. Here is the simple mapping that I use:
> > 
> > {  
> > "myType" : {  
> > "properties" : {  
> > "value" : {"type" : "double"}
> > 
> > ```
> > }
> > }
> > 
> > ```
> > 
> > }
> > 
> > When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from Elasticsearch, does the responsibility belong who uses ES clients, or should java search give me double values ?
> > 
> > Thanks in advance,  
> > Sezgin Kucukkaraaslan  
> > [www.ifountain.com](http://www.ifountain.com)

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [June 14, 2010, 6:29pm UTC](https://discuss.elastic.co/t/a-quick-question-about-mapping/3017/4 "2010-06-14T18:29:08Z")

</div>

In this case, it might happen, you should just treat it as Number and call  
xxxValue on it.

-shay.banon

2010/6/14 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)

> yes, indeed
> 
> On Mon, Jun 14, 2010 at 1:57 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > What do you use to get it back from search? Do you get the source as map?
> > 
> > -shay.banon
> > 
> > 2010/6/14 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)
> > 
> > Hi,
> > 
> > > I have a quick question about property mapping. I have an intention to  
> > > introduce a double property to an index (with default settings) and index  
> > > and search it. Here is the simple mapping that I use:
> > > 
> > > {  
> > > "myType" : {  
> > > "properties" : {  
> > > "value" : {"type" : "double"}
> > > 
> > > ```
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > }
> > > 
> > > When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from Elasticsearch, does the responsibility belong who uses ES clients, or should java search give me double values ?
> > > 
> > > Thanks in advance,  
> > > Sezgin Kucukkaraaslan  
> > > [www.ifountain.com](http://www.ifountain.com)

---

<div class="post-metadata">

### Author: ![sezgin\_kucukkaraasla](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sezgin\_kucukkaraasla](https://discuss.elastic.co/u/sezgin_kucukkaraasla)
#### Post date: [June 15, 2010, 10:22am UTC](https://discuss.elastic.co/t/a-quick-question-about-mapping/3017/5 "2010-06-15T10:22:52Z")

</div>

Thanks..

On Mon, Jun 14, 2010 at 9:29 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> In this case, it might happen, you should just treat it as Number and call  
> xxxValue on it.
> 
> -shay.banon
> 
> 2010/6/14 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)
> 
> > yes, indeed
> > 
> > On Mon, Jun 14, 2010 at 1:57 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)
> > 
> > > wrote:
> > 
> > > What do you use to get it back from search? Do you get the source as map?
> > > 
> > > -shay.banon
> > > 
> > > 2010/6/14 sezgin küçükkaraaslan [sezo104@gmail.com](mailto:sezo104@gmail.com)
> > > 
> > > Hi,
> > > 
> > > > I have a quick question about property mapping. I have an intention to  
> > > > introduce a double property to an index (with default settings) and index  
> > > > and search it. Here is the simple mapping that I use:
> > > > 
> > > > {  
> > > > "myType" : {  
> > > > "properties" : {  
> > > > "value" : {"type" : "double"}
> > > > 
> > > > ```
> > > > }
> > > > }
> > > > 
> > > > ```
> > > > 
> > > > }
> > > > 
> > > > When I use java node client to index data, I can insert an java integer value to the index, and when I search, I get it as integer also. Naturally I can't cast it to double. Is this what should I expect from Elasticsearch, does the responsibility belong who uses ES clients, or should java search give me double values ?
> > > > 
> > > > Thanks in advance,  
> > > > Sezgin Kucukkaraaslan  
> > > > [www.ifountain.com](http://www.ifountain.com)

---

<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, 4:23am UTC](https://discuss.elastic.co/t/a-quick-question-about-mapping/3017/6 "2017-07-06T04:23:18Z")

</div>


