# Tweet id (long number) being rounded

**URL:** <https://discuss.elastic.co/t/tweet-id-long-number-being-rounded/6838>\
**Category:** Elasticsearch\
**Created:** [February 29, 2012, 2:27pm UTC](https://discuss.elastic.co/t/tweet-id-long-number-being-rounded/6838 "2012-02-29T14:27:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter\_dos\_Santos\_Fi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/walter_dos_santos_fi/32/2977_2.png) [@Walter\_dos\_Santos\_Fi](https://discuss.elastic.co/u/Walter_dos_Santos_Fi)\
**Post date:** [February 29, 2012, 2:27pm UTC](https://discuss.elastic.co/t/tweet-id-long-number-being-rounded/6838/1 "2012-02-29T14:27:15Z")

</div>

Hi,

I trying to index some tweets and learn more about ES. It seems to be  
a very nice product! But I struggle with a problem. I created an index  
and defined a mapping to index only 3 fields (screen\_name, geo and  
created\_at). Also, the index stores the source.

Tweets have an identifier (id) that is stored using 64 bits. But when  
the document is inserted in ES, this field is stored with a rounded  
value in \_source field. For example, the value 174204927055368192  
becomes 174204927055368200.

I tried to find a setting in documentation to prevent this, but I  
couldn't find it.

I am using pyes HTTP and the latest version of ES. Also tried Thrift  
plugin (1.0.0) without success.

Any helps will be appreciated. Thanks in advance  
---- mapping definition ---  
{  
"tweet" : {  
"\_ttl" : { "enabled" : true, "default" : "120d" },  
"\_all" : {"enabled" : false},  
"\_source" : {"enabled" : true, "compress": true},  
"dynamic": false,  
"properties" : {  
"created\_at": {"type": "date", "index": "not\_analyzed", "format":  
"yyyy-MM-dd'T'HH:mm:ss.SSSSSS"},  
"text" : { "type" : "string", "analyzer" : "default"},  
"user": {  
"dynamic": false,  
"type": "object",  
"properties": {  
"screen\_name": {"type": "string", "index" : "not\_analyzed"}  
}  
},  
"geo": {  
"dynamic": false,  
"type": "object",  
"properties": {  
"coordinates": {"type": "geo\_point", "lat\_lon": true}  
}  
}  
}  
}  
}  
--- end mapping definition --

---

<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:** [February 29, 2012, 4:30pm UTC](https://discuss.elastic.co/t/tweet-id-long-number-being-rounded/6838/2 "2012-02-29T16:30:00Z")

</div>

long values are signed 64bit integers, provide it as a string (which is what twitter uses for ids, they moved from numeric value a long time ago). Btw, it gets rounded on your end when you construct the json, the \_source stored is the bytes of the json you provided, so when you ask for it, you get it as it was provided.

On Wednesday, February 29, 2012 at 4:27 PM, Walter dos Santos Filho wrote:

> Hi,
> 
> I trying to index some tweets and learn more about ES. It seems to be  
> a very nice product! But I struggle with a problem. I created an index  
> and defined a mapping to index only 3 fields (screen\_name, geo and  
> created\_at). Also, the index stores the source.
> 
> Tweets have an identifier (id) that is stored using 64 bits. But when  
> the document is inserted in ES, this field is stored with a rounded  
> value in \_source field. For example, the value 174204927055368192  
> becomes 174204927055368200.
> 
> I tried to find a setting in documentation to prevent this, but I  
> couldn't find it.
> 
> I am using pyes HTTP and the latest version of ES. Also tried Thrift  
> plugin (1.0.0) without success.
> 
> Any helps will be appreciated. Thanks in advance  
> ---- mapping definition ---  
> {  
> "tweet" : {  
> "\_ttl" : { "enabled" : true, "default" : "120d" },  
> "\_all" : {"enabled" : false},  
> "\_source" : {"enabled" : true, "compress": true},  
> "dynamic": false,  
> "properties" : {  
> "created\_at": {"type": "date", "index": "not\_analyzed", "format":  
> "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"},  
> "text" : { "type" : "string", "analyzer" : "default"},  
> "user": {  
> "dynamic": false,  
> "type": "object",  
> "properties": {  
> "screen\_name": {"type": "string", "index" : "not\_analyzed"}  
> }  
> },  
> "geo": {  
> "dynamic": false,  
> "type": "object",  
> "properties": {  
> "coordinates": {"type": "geo\_point", "lat\_lon": true}  
> }  
> }  
> }  
> }  
> }  
> --- end mapping definition --

---

<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, 3:37am UTC](https://discuss.elastic.co/t/tweet-id-long-number-being-rounded/6838/3 "2017-07-06T03:37:49Z")

</div>


