Last active
December 30, 2015 03:59
-
-
Save tikitu/7773227 to your computer and use it in GitHub Desktop.
ElasticSearch: bug in output format of field of type "byte" when using ?fields= with document get.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST "http://localhost:9200/my_index/my_type/_mapping" -d' | |
{ | |
"my_type": { | |
"properties": { | |
"byte_field": {"type": "byte"}, | |
"int_field": {"type": "integer"}, | |
"long_field": {"type": "long"} | |
} | |
} | |
}' | |
curl -XPOST "http://localhost:9200/my_index/my_type/1" -d' | |
{"byte_field":3, "int_field":4, "long_field":5}' | |
curl -XGET "http://localhost:9200/my_index/my_type/1?pretty=true" | |
# Returns: | |
#{ | |
# "_index": "my_index", | |
# "_type": "my_type", | |
# "_id": "1", | |
# "_version": 1, | |
# "exists": true, | |
# "_source": { | |
# "byte_field": 3, | |
# "int_field": 4, | |
# "long_field": 5 | |
# } | |
#} | |
curl -XGET "http://localhost:9200/my_index/my_type/1?fields=byte_field,int_field,long_field&pretty=true" | |
# Returns: | |
#{ | |
# "_index": "my_index", | |
# "_type": "my_type", | |
# "_id": "1", | |
# "_version": 1, | |
# "exists": true, | |
# "fields": { | |
# "int_field": 4, | |
# "long_field": 5, | |
# "byte_field": "3" | |
# } | |
#} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue is the string value of "byte_field" in the last request.