Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top Hits aggregation #37341

Closed
markov00 opened this issue May 29, 2019 · 2 comments · Fixed by #38391
Closed

Top Hits aggregation #37341

markov00 opened this issue May 29, 2019 · 2 comments · Fixed by #38391
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) regression

Comments

@markov00
Copy link
Member

markov00 commented May 29, 2019

Kibana version:
since 6.5

Describe the bug:
if you create a visualization with Top Hits as metric, the field list is not filtered.
The Top Hits aggregation, on visualization expect numbers. Only table accept also strings.
This will lead to some confusion by the user when trying to use top hits.

Steps to reproduce:

  1. Create a piechart
  2. Add a metric and select top hits as aggergation
  3. The field dropdown will show a full list of fields for the selected index pattern.

Expected behavior:
The list should be filtered out to only the usable fields.

Screenshots:
Screenshot 2019-05-29 at 17 29 39

Any additional context:

The issue is a regression introduced by this PR #22756

There is a small typo on the aggType filter where the we are looking for aggConfig.type.name !== 'top_hit' instead of top_hits in as the MetricAggType name reports. I think this can be the only cause of that problem

if (aggConfig.type.name !== 'top_hit' || vis.type.name === 'table' || vis.type.name === 'metric') {
return true;
}
return field.type === 'number';
});
export const topHitMetricAgg = new MetricAggType({
name: 'top_hits',

@markov00 markov00 added bug Fixes for quality problems that affect the customer experience Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) regression :AppArch labels May 29, 2019
@markov00 markov00 self-assigned this May 29, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch

@markov00
Copy link
Member Author

@ppisljar do you think my assumptions are right on the resolution of this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants