Skip to content

Instantly share code, notes, and snippets.

@hindman
Created November 21, 2013 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hindman/7591513 to your computer and use it in GitHub Desktop.
Save hindman/7591513 to your computer and use it in GitHub Desktop.
ElasticSearch error: URLs with ?fields parameter: No matching token for number_type BIG_INTEGER
# 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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment