# Bigint values in elasticsearch

**URL:** <https://discuss.elastic.co/t/bigint-values-in-elasticsearch/72786>\
**Category:** Elasticsearch\
**Created:** [January 25, 2017, 3:17pm UTC](https://discuss.elastic.co/t/bigint-values-in-elasticsearch/72786 "2017-01-25T15:17:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinodMS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinodms/32/13476_2.png) [@vinodMS](https://discuss.elastic.co/u/vinodMS)\
**Post date:** [January 25, 2017, 3:17pm UTC](https://discuss.elastic.co/t/bigint-values-in-elasticsearch/72786/1 "2017-01-25T15:17:11Z")

</div>

currently I am using logstash to query the mysql db and index data in elasticsearch. I currently see the following error,

`@data={"id"=>592753, "source"=>"Add new address", "target"=>"加入新的地址", "lastmodified"=>"2008-04-07T23:04:26.000Z", "sourcedigest"=>12120909617543216096, "targetdigest"=>8116712605014414362, "sourcewordcount"=>3, "targetwordcount"=>6, "upload_id"=>399, "@version"=>"1", "@timestamp"=>"2017-01-25T14:54:09.879Z", "tags"=>["_elasticsearch_lookup_failure"]}, @metadata_accessors=#<LogStash::Util::Accessors:0x3543bfdb @store={}, @lut={}>, @cancelled=false>], :response=>{"index"=>{"_index"=>"en-us_zh-hk", "_type"=>"segment", "_id"=>"592753", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"No matching token for number_type [BIG_INTEGER]"}}}}, :level=>:warn}`

The "sourcedigest" field seems to be the issue here, as it has a field type long. but the actual value cannot be stored in the long field. Do I have solution/workaround here?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [January 25, 2017, 3:30pm UTC](https://discuss.elastic.co/t/bigint-values-in-elasticsearch/72786/2 "2017-01-25T15:30:05Z")

</div>

> [@vinodMS](#):
>
> Do I have solution/workaround here?

Send as a string mapped to a field of type `keyword`. It looks like you'll need to wrap the number in quotes too otherwise it is returned in a truncated form in results:

```
DELETE test
PUT test
{
   "settings": {
	  "index": {
		 "number_of_shards": 1
	  }    
   },
   "mappings": {
	  "doc": {
		 "properties": {
			"num": {
			   "type": "keyword"
			}
		 }
	  }
   }
}
POST test/doc/bad
{
	"num":12120909617543216096
}
POST test/doc/ok
{
	"num":"12120909617543216096"
}
GET test/doc/_search
{
	"query":{
		"match":{
			"num":12120909617543216096
		}
	}
}

```

---

<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:** [February 22, 2017, 3:30pm UTC](https://discuss.elastic.co/t/bigint-values-in-elasticsearch/72786/3 "2017-02-22T15:30:26Z")

</div>

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