-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[data.search.aggs]: Expression functions for bucket agg types #64772
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
…s agg types + significant terms
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.
Overall looks great -- thanks for powering through all of these! I have a few comments, mostly just nits around the help text, and a couple of questions.
The only broader thing I'm noticing is that, looking at agg_type.ts
, it seems that customLabel
param is also magically appended to every agg type (much like json
), unless it is explicitly false.
I think this means that we will need to add a customLabel
arg to every expression function as well 🙁
I'm wondering if it makes sense to use a base interface for each of the params to extend from, which can contain some of these global things, e.g.
interface AggParamsFilter extends BaseAggParams {}
But I'm also fine with duplicating them in each interface like we've done for json
, it's just a matter of remembering them.
WDYT?
Co-authored-by: Luke Elmers <[email protected]>
Co-authored-by: Luke Elmers <[email protected]>
Co-authored-by: Luke Elmers <[email protected]>
Co-authored-by: Luke Elmers <[email protected]>
Co-authored-by: Luke Elmers <[email protected]>
Co-authored-by: Luke Elmers <[email protected]>
Co-authored-by: Luke Elmers <[email protected]>
# Conflicts: # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.daterangekey.from.md # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.daterangekey.md # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.daterangekey.to.md # docs/development/plugins/data/public/kibana-plugin-plugins-data-public.iprangekey.md # src/plugins/data/public/public.api.md # src/plugins/data/public/search/aggs/types.ts
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.
Overall revisions LGTM, just one more note
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.
LGTM!
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.
Code LGTM! One small nit on customLabels
in filters
, otherwise no remaining concerns on my end.
export interface AggParamsFilters extends BaseAggParams { | ||
filters?: Array<{ | ||
input: Query; | ||
label: string; | ||
}>; | ||
} |
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.
To make this interface accurate, don't we need to override the customLabels
from BaseAggParams
here, since AggParamsFilters
explicitly sets it to false
and therefore it isn't a valid param at all?
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…c#64772) * [data.search.aggs]: Expression functions for bucket agg types - ranges agg types + significant terms * new portion of changes * add geo_tile_fn * add geo_hash_fn * Update src/plugins/data/public/search/aggs/buckets/filter_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_tile_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/ip_range_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * create BaseAggParams * add filters_fn * add histogram / date_histogram expression functions * cleanup * terms - order should be optional * add custom label params Co-authored-by: Luke Elmers <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
#65227) * [data.search.aggs]: Expression functions for bucket agg types - ranges agg types + significant terms * new portion of changes * add geo_tile_fn * add geo_hash_fn * Update src/plugins/data/public/search/aggs/buckets/filter_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_tile_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/ip_range_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * Update src/plugins/data/public/search/aggs/buckets/geo_hash_fn.ts Co-authored-by: Luke Elmers <[email protected]> * create BaseAggParams * add filters_fn * add histogram / date_histogram expression functions * cleanup * terms - order should be optional * add custom label params Co-authored-by: Luke Elmers <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Luke Elmers <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Closes #63762
Summary
In this PR new
expression functions
were created for the followingbucket
agg types:date_histogram
histogram
date_range
ip_range
filter
filters
significant_terms
geo_hash
geo_tile
Checklist
Delete any items that are not applicable to this PR.
For maintainers