Commit f121e830 by Shani Elharrar

ElasticSearch Terms & Date Histogram: Support 'missing' setting

parent 1d8222ef
......@@ -27,6 +27,7 @@ function (angular, _, queryDef) {
$scope.orderByOptions = [];
$scope.bucketAggTypes = queryDef.bucketAggTypes;
$scope.bucketAggTypesHash = _.indexBy(queryDef.bucketAggTypes, 'value');
$scope.orderOptions = queryDef.orderOptions;
$scope.sizeOptions = queryDef.sizeOptions;
......
......@@ -57,7 +57,7 @@
</ul>
<div class="clearfix"></div>
</div>
<div class="tight-form last">
<div class="tight-form">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 170px">
Trim edges points
......@@ -71,11 +71,23 @@
</ul>
<div class="clearfix"></div>
</div>
<div class="tight-form last">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 170px;">
Missing
<tip>The missing parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value</tip>
</li>
<li>
<input type="text" class="tight-form-input last" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<div class="tight-form-inner-box" ng-if="agg.type === 'terms'">
<div class="tight-form">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 60px">
<li class="tight-form-item" style="width: 100px">
Order
</li>
<li>
......@@ -86,7 +98,7 @@
</div>
<div class="tight-form">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 60px">
<li class="tight-form-item" style="width: 100px">
Size
</li>
<li>
......@@ -95,9 +107,9 @@
</ul>
<div class="clearfix"></div>
</div>
<div class="tight-form last">
<div class="tight-form">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 60px">
<li class="tight-form-item" style="width: 100px">
Order By
</li>
<li>
......@@ -106,6 +118,18 @@
</ul>
<div class="clearfix"></div>
</div>
<div class="tight-form last">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 100px;">
Missing
<tip>The missing parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value</tip>
</li>
<li>
<input type="text" class="tight-form-input last" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<div class="tight-form-inner-box" ng-if="agg.type === 'filters'">
<div class="tight-form" ng-repeat="filter in agg.settings.filters" ng-class="{last: $last}">
......@@ -129,5 +153,3 @@
</div>
</div>
......@@ -48,6 +48,10 @@ function (queryDef) {
}
}
if (aggDef.settings.missing) {
queryNode.terms.missing = aggDef.settings.missing;
}
return queryNode;
};
......@@ -67,6 +71,10 @@ function (queryDef) {
esAgg.format = "epoch_millis";
}
if (settings.missing) {
esAgg.missing = settings.missing;
}
return esAgg;
};
......
......@@ -20,9 +20,9 @@ function (_) {
],
bucketAggTypes: [
{text: "Terms", value: 'terms' },
{text: "Terms", value: 'terms', supportsMissing: true },
{text: "Filters", value: 'filters' },
{text: "Date Histogram", value: 'date_histogram' },
{text: "Date Histogram", value: 'date_histogram', supportsMissing: true },
],
orderByOptions: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment