Elasticsearch version:
{
"version": {
"number": "5.4.2",
"build_hash": "929b078",
"build_date": "2017-06-15T02:29:28.122Z",
"build_snapshot": false,
"lucene_version": "6.5.1"
}
}
Description of the problem including expected versus actual behavior:
When query asks for stored_fields, in the result, fields of type date are returned as string, even though they are defined as long (epoch_millis). In ES version 1.X it would be long.
Steps to reproduce:
- Create an index with one date field with the following mapping:
{
"type": "date",
"store" : true,
"format" : "epoch_millis"
}
- Index a document with some date value.
- Make the following search query:
{
"query":{ "match_all": {} },
"stored_fields": [ "mydate" ]
}
- The result is as follow:
{
"took": 7,
"timed_out": false,
"_shards": {},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "foo",
"_type": "bar",
"_id": "1162256",
"_score": 1,
"fields": {
"mydate": [
"1504540873381"
]
}
}
]
}
}
Elasticsearch version:
{ "version": { "number": "5.4.2", "build_hash": "929b078", "build_date": "2017-06-15T02:29:28.122Z", "build_snapshot": false, "lucene_version": "6.5.1" } }Description of the problem including expected versus actual behavior:
When query asks for
stored_fields, in the result, fields of type date are returned as string, even though they are defined as long (epoch_millis). In ES version 1.X it would be long.Steps to reproduce:
{ "type": "date", "store" : true, "format" : "epoch_millis" }{ "query":{ "match_all": {} }, "stored_fields": [ "mydate" ] }{ "took": 7, "timed_out": false, "_shards": {}, "hits": { "total": 1, "max_score": 1, "hits": [ { "_index": "foo", "_type": "bar", "_id": "1162256", "_score": 1, "fields": { "mydate": [ "1504540873381" ] } } ] } }