mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Add significant terms in tag cloud visualization (#17770)
* Allow significant terms for tag cloud * Fix request before terms aggregation has configured * Check if at least one agg is in array
This commit is contained in:
parent
7625c3fcd4
commit
ef8657067a
2 changed files with 7 additions and 2 deletions
|
@ -55,7 +55,7 @@ VisTypesRegistryProvider.register(function (Private) {
|
|||
title: 'Tags',
|
||||
min: 1,
|
||||
max: 1,
|
||||
aggFilter: ['terms']
|
||||
aggFilter: ['terms', 'significant_terms']
|
||||
}
|
||||
])
|
||||
}
|
||||
|
|
|
@ -92,7 +92,12 @@ export class TagCloudVisualization {
|
|||
}
|
||||
|
||||
const data = response.tables[0];
|
||||
this._bucketAgg = this._vis.aggs.find(agg => agg.type.name === 'terms');
|
||||
const segmentAggs = this._vis.aggs.bySchemaName.segment;
|
||||
if (segmentAggs && segmentAggs.length > 0) {
|
||||
this._bucketAgg = segmentAggs[0];
|
||||
} else {
|
||||
this._bucketAgg = null;
|
||||
}
|
||||
|
||||
const tags = data.rows.map(row => {
|
||||
const [tag, count] = row;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue