-
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] Move sort out of top hits configuration for ES documents source #47361
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
💔 Build Failed |
cc @Alex3k This PR allows you to sort top hits by numerical fields if you want to try it out and ensure this solves your use case |
💔 Build Failed |
💚 Build Succeeded |
💔 Build Failed |
retest |
💔 Build Failed |
another failure in machine_learning/anomaly_detection/saved_search_job·ts retest |
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.
mostly nits tbh. Agreed that this is a nice improvement, and might enable a few more use-cases.
disabled={!this.props.sortField} | ||
options={[ | ||
{ text: 'ASC', value: SORT_ORDER.ASC }, | ||
{ text: 'DESC', value: SORT_ORDER.DESC } |
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.
ascending/descending fully spelled out? (and localize i18n too)
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.
I am hesitant to do this since spelling out ascending/descending will take a lot of horizontal space and shorten the sort field select. IMHO, the sort field select needs to be as long as possible to handle long field names. Spelling out asc/desc adds little value compared to more room for long field names
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.
Maybe I could change the select to just an up or down icon?
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.
A fully spelled out "Ascending" and "Descending" select box appears to be consistent with other visualizations.
@@ -56,9 +56,10 @@ export class ESSearchSource extends AbstractESSource { | |||
geoField: descriptor.geoField, | |||
filterByMapBounds: _.get(descriptor, 'filterByMapBounds', DEFAULT_FILTER_BY_MAP_BOUNDS), | |||
tooltipProperties: _.get(descriptor, 'tooltipProperties', []), | |||
sortField: _.get(descriptor, 'sortField', ''), | |||
sortOrder: _.get(descriptor, 'sortOrder', SORT_ORDER.DESC), |
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.
consider wrapping this in single config object
sort: {
order: ...,
field: ...
}
looks a little cleaner, as they are co-dependent
x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/es_search_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js
Outdated
Show resolved
Hide resolved
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
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, fwiw, I have no opinion either way on the ascending/descending. Great addition.
elastic#47361) * [Maps] Move sort out of top hits configuration for ES documents source * add migration script to convert topHitsTimeField to sortField * update i18n translations * add jest test for es docs source UpdateSourceEditor component * remove time configuration from top hits docs * update migrations integration expect statement * review feedback * reverse hits list so top documents by sort are drawn on top * update functional test expect to account for reversing hits order * update another functional test expect clause for reversing hits
#47361) (#47732) * [Maps] Move sort out of top hits configuration for ES documents source * add migration script to convert topHitsTimeField to sortField * update i18n translations * add jest test for es docs source UpdateSourceEditor component * remove time configuration from top hits docs * update migrations integration expect statement * review feedback * reverse hits list so top documents by sort are drawn on top * update functional test expect to account for reversing hits order * update another functional test expect clause for reversing hits
closes #46882 and #47279
This PR replaces
topHitsTimeField
withsortField
andsortOrder
and allows users to sort documents and top hit documents by any sortable field, including numbers