Fix for annotations query on ES 5.x

This commit is contained in:
Leandro Piccilli 2016-08-11 22:24:58 +02:00
parent 3057c9747c
commit f844cd844b

View File

@ -82,11 +82,15 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
var query = { "bool": { "must": [{ "range": range }, { "query_string": { "query": queryInterpolated } }] }}; var query = { "bool": { "must": [{ "range": range }, { "query_string": { "query": queryInterpolated } }] }};
var data = { var data = {
"fields": [timeField, "_source"],
"query" : query, "query" : query,
"size": 10000 "size": 10000
}; };
// fields field not supported on ES 5.x
if (this.esVersion < 5) {
data["fields"] = [timeField, "_source"];
}
var header = {search_type: "query_then_fetch", "ignore_unavailable": true}; var header = {search_type: "query_then_fetch", "ignore_unavailable": true};
// old elastic annotations had index specified on them // old elastic annotations had index specified on them