use fielddata_fields in elasticsearch 2.x queries

Resolves issue #8467
This commit is contained in:
Victor Azevedo 2017-05-25 11:43:29 -04:00 committed by Torkel Ödegaard
parent 896f849b84
commit 980b9b5ca0

View File

@ -118,8 +118,12 @@ function (queryDef) {
query.fields = ["*", "_source"];
}
query.script_fields = {},
query.docvalue_fields = [this.timeField];
query.script_fields = {};
if (this.esVersion < 5) {
query.fielddata_fields = [this.timeField];
} else {
query.docvalue_fields = [this.timeField];
}
return query;
};