# URLs with ?fields parameter: getting error: No matching token for number\_type BIG\_INTEGER

**URL:** <https://discuss.elastic.co/t/urls-with-fields-parameter-getting-error-no-matching-token-for-number-type-big-integer/14529>\
**Category:** Elasticsearch\
**Created:** [November 21, 2013, 11:09pm UTC](https://discuss.elastic.co/t/urls-with-fields-parameter-getting-error-no-matching-token-for-number-type-big-integer/14529 "2013-11-21T23:09:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monty\_Hindman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monty_hindman/32/1952_2.png) [@Monty\_Hindman](https://discuss.elastic.co/u/Monty_Hindman)\
**Post date:** [November 21, 2013, 11:09pm UTC](https://discuss.elastic.co/t/urls-with-fields-parameter-getting-error-no-matching-token-for-number-type-big-integer/14529/1 "2013-11-21T23:09:41Z")

</div>

My project has documents with very large integers. In order to index those  
documents, I have to set their types to string (or double) -- either one  
works.

However, I get the following exception whenever a URL includes a "?fields="  
parameter.

Here's a simple demonstration (also available as a Gist:  
[https://gist.github.com/hindman/7591513](https://gist.github.com/hindman/7591513)):

# Create index.

curl -X DELETE localhost:9200/xx  
curl -X PUT localhost:9200/xx

# Set up the mapping to handle very large integer fields.

curl -X PUT localhost:9200/xx/yy/\_mapping -d '{"yy": {"properties": {"a":  
{"type": "string"}, "b": {"type": "string"}}}}'

# Index two documents, the second having very large integers.

curl -X PUT localhost:9200/xx/yy/1 -d '{"a": 123, "b": 456}'  
curl -X PUT localhost:9200/xx/yy/2 -d '{"a": 933655199414565157, "b":  
9917602859033623819}'

# Everything is working so far: I can retrieve the documents.

curl -X GET localhost:9200/xx/yy/1  
curl -X GET localhost:9200/xx/yy/2

# I can use a ?fields= query parameter with the first document.

curl -X GET localhost:9200/xx/yy/1?fields=a,b

# But not with the second.

curl -X GET localhost:9200/xx/yy/2?fields=a,b

{"error":"ElasticSearchIllegalStateException[No matching token for  
number\_type [BIG\_INTEGER]]","status":500}

Here's my version info: 0.90.5, Build: c8714e8/2013-09-17T12:50:20Z, JVM:  
1.6.0\_65.

Am I doing something incorrectly, or is there a workaround? Thanks.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 22, 2013, 7:46am UTC](https://discuss.elastic.co/t/urls-with-fields-parameter-getting-error-no-matching-token-for-number-type-big-integer/14529/2 "2013-11-22T07:46:21Z")

</div>

Hi,

I played a little with your gist (thanks BTW for providing a full curl recreation. It really helps a lot!)

You defined a mapping with a and b as string.  
If you change your PUT requests to this:  
curl -X PUT localhost:9200/xx/yy/1 -d '{"a": "123", "b": "456"}'  
curl -X PUT localhost:9200/xx/yy/2 -d '{"a": "933655199414565157", "b": "9917602859033623819"}'

Everything works fine.

If you try ton change the mapping and use numbers (long) instead of string, you will get that message when putting the 2nd document :

{"error":"MapperParsingException[failed to parse [b]]; nested: JsonParseException[Numeric value (9917602859033623819) out of range of long (-9223372036854775808 - 9223372036854775807)\n at [Source: [B@18b0a0; line: 1, column: 51]]; ","status":400}

Best

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 22 novembre 2013 at 00:09:44, Monty Hindman ([montyhindman@gmail.com](mailto:montyhindman@gmail.com)) a écrit:

My project has documents with very large integers. In order to index those documents, I have to set their types to string (or double) -- either one works.

However, I get the following exception whenever a URL includes a "?fields=" parameter.

Here's a simple demonstration (also available as a Gist: [https://gist.github.com/hindman/7591513](https://gist.github.com/hindman/7591513)):

# Create index.

curl -X DELETE localhost:9200/xx  
curl -X PUT localhost:9200/xx

# Set up the mapping to handle very large integer fields.

curl -X PUT localhost:9200/xx/yy/\_mapping -d '{"yy": {"properties": {"a": {"type": "string"}, "b": {"type": "string"}}}}'

# Index two documents, the second having very large integers.

curl -X PUT localhost:9200/xx/yy/1 -d '{"a": 123, "b": 456}'  
curl -X PUT localhost:9200/xx/yy/2 -d '{"a": 933655199414565157, "b": 9917602859033623819}'

# Everything is working so far: I can retrieve the documents.

curl -X GET localhost:9200/xx/yy/1  
curl -X GET localhost:9200/xx/yy/2

# I can use a ?fields= query parameter with the first document.

curl -X GET localhost:9200/xx/yy/1?fields=a,b

# But not with the second.

curl -X GET localhost:9200/xx/yy/2?fields=a,b

{"error":"ElasticSearchIllegalStateException[No matching token for number\_type [BIG\_INTEGER]]","status":500}

Here's my version info: 0.90.5, Build: c8714e8/2013-09-17T12:50:20Z, JVM: 1.6.0\_65.

## Am I doing something incorrectly, or is there a workaround? Thanks.

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).  
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).  
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, 2:05am UTC](https://discuss.elastic.co/t/urls-with-fields-parameter-getting-error-no-matching-token-for-number-type-big-integer/14529/3 "2017-07-06T02:05:26Z")

</div>


