-
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
[Lens] Implement rare terms #121500
[Lens] Implement rare terms #121500
Conversation
cc @MichaelMarcialis tests are failing, but I think we can start thinking about the open UI questions already |
@ghudgins @MichaelMarcialis Just discussed this in the dev sync and @dej611 suggested to make this a new function instead of hacking it in as a rank option (there would be "Rare values" and "Top values"). In the rare values config UI there's just max doc count, no disabled features. |
i'm speaking purely user interface here but "top values" implies the top of some list ordered by something. I think rare terms fits better in the top values function for this reason....if we have "rare values" then we could apply this logic and have "alphabetical values" and it gets too verbose. if there's a good technical reason to keep it separate then we can adjust but using Lens as a translation for these technical details was something I was hoping we could work in. just my opinion though... @MichaelMarcialis? |
No technical reason to keep them apart, it doesn't matter much either way - our operations architecture is flexible enough to handle both ways well |
I think I agree with you for the general case. I have no strong opinion here, but just thought it may be useful to discuss this peculiar case. |
I don't have a strong opinion here - given that this is more of an expert feature anyway (an everyday user won't look at the rare terms) I'm leaning slightly towards keeping it as a special sorting option so it's not bloating the list of operations with "weird" things. |
I don't have a particularly strong opinion here regarding whether this should be a standalone quick function versus a sorting option within the existing top values function. My only concern with adding it as a sorting option to the top values function is discoverability. However, if we're comfortable making the feature a bit less discoverable, then it's a non-issue (which I assume is indeed the case, given Joe's description of it being a more expert feature). |
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
Pinging @elastic/kibana-app-services (Team:AppServicesSv) |
Not sure why docs build is failing - the build contains this line:
|
@elasticmachine merge upstream |
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.
rare terms agg addition lgtm
@elasticmachine merge upstream |
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.
x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx
Outdated
Show resolved
Hide resolved
label={i18n.translate('xpack.lens.indexPattern.terms.maxDocCount', { | ||
defaultMessage: 'Max doc count per term', | ||
})} | ||
maxValue={100} |
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.
Where this value come from?
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.
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.
Moved it into a constant, magic numbers are bad
Good catch about the label thing - the problem is that the label input is storing the "old" value internally but it doesn't refresh if the order by is changed. Fixed it by re-rendering the label input in case the default label changes and the user hasn't changed it yet. This is fixing the same issue for the case if the user is changing the field name, then clearing the label input. @dej611 could you review again? |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
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.
Tested again and it worked fine 👍
This PR adds support for rare terms to aggconfigs and Lens.
Be aware of the following things:
If a precision warning is shown and the current sorting is ascending count, there's a call to action button to turn it into rare terms:
Title changes automatically to "Rare values of"
Sorting can be enabled from the flyout by picking "Rarity" in the ranking options:
If it's picked, the "add field" button, the "size" input, order direction and existing advanced options are greyed out because they are not applicable. A new input is shown for the max doc count. Max doc count is defaulting to
1
which is also the min value. The maximum value is 100 (both values set by Elasticsearch in the same way)