mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
ES - Support for min_doc_count on group by terms (#7324)
This commit is contained in:
parent
a0c8380baf
commit
cf9790fc4c
@ -82,12 +82,17 @@ function (angular, _, queryDef) {
|
|||||||
case 'terms': {
|
case 'terms': {
|
||||||
settings.order = settings.order || "asc";
|
settings.order = settings.order || "asc";
|
||||||
settings.size = settings.size || "10";
|
settings.size = settings.size || "10";
|
||||||
|
settings.min_doc_count = settings.min_doc_count || 0;
|
||||||
settings.orderBy = settings.orderBy || "_term";
|
settings.orderBy = settings.orderBy || "_term";
|
||||||
|
|
||||||
if (settings.size !== '0') {
|
if (settings.size !== '0') {
|
||||||
settingsLinkText = queryDef.describeOrder(settings.order) + ' ' + settings.size + ', ';
|
settingsLinkText = queryDef.describeOrder(settings.order) + ' ' + settings.size + ', ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.min_doc_count > 0) {
|
||||||
|
settingsLinkText += 'Min Doc Count: ' + settings.min_doc_count + ', ';
|
||||||
|
}
|
||||||
|
|
||||||
settingsLinkText += 'Order by: ' + queryDef.describeOrderBy(settings.orderBy, $scope.target);
|
settingsLinkText += 'Order by: ' + queryDef.describeOrderBy(settings.orderBy, $scope.target);
|
||||||
|
|
||||||
if (settings.size === '0') {
|
if (settings.size === '0') {
|
||||||
|
@ -61,6 +61,10 @@
|
|||||||
<label class="gf-form-label width-10">Size</label>
|
<label class="gf-form-label width-10">Size</label>
|
||||||
<metric-segment-model property="agg.settings.size" options="sizeOptions" on-change="onChangeInternal()" css-class="width-12"></metric-segment-model>
|
<metric-segment-model property="agg.settings.size" options="sizeOptions" on-change="onChangeInternal()" css-class="width-12"></metric-segment-model>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="gf-form offset-width-7">
|
||||||
|
<label class="gf-form-label width-10">Min Doc Count</label>
|
||||||
|
<input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
|
||||||
|
</div>
|
||||||
<div class="gf-form offset-width-7">
|
<div class="gf-form offset-width-7">
|
||||||
<label class="gf-form-label width-10">Order By</label>
|
<label class="gf-form-label width-10">Order By</label>
|
||||||
<metric-segment-model property="agg.settings.orderBy" options="orderByOptions" on-change="onChangeInternal()" css-class="width-12"></metric-segment-model>
|
<metric-segment-model property="agg.settings.orderBy" options="orderByOptions" on-change="onChangeInternal()" css-class="width-12"></metric-segment-model>
|
||||||
|
@ -49,6 +49,10 @@ function (queryDef) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aggDef.settings.min_doc_count !== void 0) {
|
||||||
|
queryNode.terms.min_doc_count = parseInt(aggDef.settings.min_doc_count, 10);
|
||||||
|
}
|
||||||
|
|
||||||
if (aggDef.settings.missing) {
|
if (aggDef.settings.missing) {
|
||||||
queryNode.terms.missing = aggDef.settings.missing;
|
queryNode.terms.missing = aggDef.settings.missing;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user