-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps] add Top term aggregation #57875
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So sweet getting these additional new features dialed in. It really matures the feature-set tremendously.
x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js
Outdated
Show resolved
Hide resolved
@@ -178,12 +164,23 @@ export class ESGeoGridSource extends AbstractESAggSource { | |||
async getGeoJsonWithMeta(layerName, searchFilters, registerCancelCallback) { | |||
const indexPattern = await this.getIndexPattern(); | |||
const searchSource = await this._makeSearchSource(searchFilters, 0); | |||
const aggConfigs = new AggConfigs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 getting rid of agg-configs.
Probably can remove corresponding mock as well:
jest.mock('ui/agg_types', () => ({ |
cc @aaronjcaldwell I think we're only down to usage for bounds-agg after this.
import { AggConfigs } from 'ui/agg_types'; |
@elasticmachine merge upstream |
Thanks for investigating the composite agg. I would be hesitant to replace the existing implementation.
I would only create a composite-aggs, if a top-terms is present in the metric-config. It seems like the most conservative choice. It would prevent us from pre-emptively fixing an issue that has not been raised, but still allow us to introduce the top-terms functionality more generically instead of limiting it to just using it in blended-layers. Later, we can always still remove the default implementation if using composite-aggs did not introduce any unintended consequences. |
I have added a separate path for when there are no term sub-aggregations. |
x-pack/legacy/plugins/maps/public/layers/sources/es_pew_pew_source/convert_to_lines.test.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/convert_to_geojson.test.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/geo_tile_utils.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small cleanup suggestions. Can you create a follow-up ticket for the getMetrics
issue?
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/util/es_agg_utils.test.js
Outdated
Show resolved
Hide resolved
Created #58560 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment left-over. Thanks, great functionality. not only to make blended-layers work, but also as stand-alone!
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* [Maps] add Top term aggregation * update pew-pew source to handle terms agg * make helper function for pulling values from bucket * update terms source * better join labels * categoricla meta * remove unused constant * remove unused changes * remove unused constant METRIC_SCHEMA_CONFIG * update jest expect * fix auto complete suggestions for top term * get category autocomplete working with style props from joins * pluck categorical style meta with real field name * mock MetricsEditor to fix jest test * review feedback * es_agg_utils.js to es_agg_utils.ts * typing updates * use composit agg to avoid search.buckets limit * i18n update and functional test fix * stop paging through results when request is aborted * remove unused file * do not use composite agg when no terms sub-aggregations * clean up * pass indexPattern to getValueAggsDsl * review feedback * more review feedback * ts-ignore for untyped imports in tests * more review feedback * add bucket.hasOwnProperty check Co-authored-by: Elastic Machine <[email protected]>
* [Maps] add Top term aggregation * update pew-pew source to handle terms agg * make helper function for pulling values from bucket * update terms source * better join labels * categoricla meta * remove unused constant * remove unused changes * remove unused constant METRIC_SCHEMA_CONFIG * update jest expect * fix auto complete suggestions for top term * get category autocomplete working with style props from joins * pluck categorical style meta with real field name * mock MetricsEditor to fix jest test * review feedback * es_agg_utils.js to es_agg_utils.ts * typing updates * use composit agg to avoid search.buckets limit * i18n update and functional test fix * stop paging through results when request is aborted * remove unused file * do not use composite agg when no terms sub-aggregations * clean up * pass indexPattern to getValueAggsDsl * review feedback * more review feedback * ts-ignore for untyped imports in tests * more review feedback * add bucket.hasOwnProperty check Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Closes #11223
This PR adds
Terms
aggregation to aggregation selection list. This allows users to create maps with clusters and joins that can be styled by top term.This feature is required for blended layer. This will allow clusters in blended layer to have roll-up style when documents are styled by category.