mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'keep_es_version' of https://github.com/replay/grafana into replay-keep_es_version
This commit is contained in:
@@ -5,11 +5,18 @@ function () {
|
||||
|
||||
function ElasticQueryBuilder(options) {
|
||||
this.timeField = options.timeField;
|
||||
this.elasticsearchVersion = options.elasticsearchVersion;
|
||||
}
|
||||
|
||||
ElasticQueryBuilder.prototype.getRangeFilter = function() {
|
||||
var filter = {};
|
||||
filter[this.timeField] = {"gte": "$timeFrom", "lte": "$timeTo"};
|
||||
|
||||
// elastic search versions 2.x require the time format to be specified
|
||||
if (this.elasticsearchVersion >= 2) {
|
||||
filter[this.timeField]["format"] = "epoch_millis";
|
||||
}
|
||||
|
||||
return filter;
|
||||
};
|
||||
|
||||
@@ -130,6 +137,10 @@ function () {
|
||||
"min_doc_count": 0,
|
||||
"extended_bounds": { "min": "$timeFrom", "max": "$timeTo" }
|
||||
};
|
||||
// elastic search versions 2.x require the time format to be specified
|
||||
if (this.elasticsearchVersion >= 2) {
|
||||
esAgg["date_histogram"]["format"] = "epoch_millis";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'filters': {
|
||||
|
||||
Reference in New Issue
Block a user