-
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
[Discover] Field List - refactor sections to align with Lens implementation #135678
Comments
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
Dima is working on API refactoring #139453 |
Reposting the note from the meta issue here:
|
@jughosta thx, I think one of the next steps could be, create a hook in Discover that could fetch the existing fields, and use it in field statistics, remove the logic of the observable that we populate in the sidebar to use in the Field Statistic tab. feels this would be a good start for the field statistics work later on (that we should discuss separately) |
…to Discover (#144412) Closes #135678 ## Summary This PR continues the work started in #142758 to bring field list grouping from Lens into Discover. - [x] Integrate new components and hooks into Discover page - [x] Refactor fields grouping logic - [x] Render Popular fields under a new separate section - [x] Remove "Hide empty fields" switch - [x] Adjust filtering logic - [x] Refactor fields existence logic in Discover - [x] Add "Unmapped fields" section - [x] Highlight the matching term when searching for a field - [x] Show field icons when in SQL mode - [x] Add tooltips to field list section headings - [x] Add tests, clean up <img width="340" alt="Screenshot 2022-11-15 at 15 39 27" src="https://user-images.githubusercontent.com/1415710/201947349-726ffc3a-a17f-411b-be92-81d97879765a.png"> For testing on Discover page: Please check different use cases and toggling Advanced Settings: - regular vs ad-hoc data views - data views with and without a time field - data views with unmapped and empty fields - data views with a lot of fields - data views with some fields being filtered out via data view configuration - updating query, filters, and time range - regular and SQL mode - searching by a field name in the sidebar - applying a field filter in the sidebar - adding, editing, and removing a field - Field Statistics table when some columns are selected or no columns are selected - multifields in the field popover should work as before (icon should change from "+" to "x" when subfield is selected as a column) - `discover:searchOnPageLoad` should not show fields if turned off - `discover:searchFieldsFromSource` should show multifields right in the fields list if enabled - `discover:enableSql` should show Selected and Available fields only when enabled - `discover:showLegacyFieldTopValues` should show old (green) field stats in its popover - `doc_table:legacy` On Lens page: - scroll position should reset when data view is switched or when searching by a field name - regular and SQL mode ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) Co-authored-by: Michael Marcialis <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]>
Part 1 #142758
Part 2:
More context
Currently in Discover, we calculate the
available fields
by the data returned by Elasticsearch.To show all fields users need to change the
Hide empty fields
filterHere's where the field statistics are calculated:
kibana/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx
Lines 135 to 145 in bcbef78
Here's where available fields + selected fields are sent to the field statistics by observable (Note: sending selected fields should not be necessary, since it's in our state, to send the available fields by observable is something we could reconsider, POC PR: #138238)
kibana/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx
Lines 188 to 201 in bcbef78
Here's where the grouping of the fields into (selected, popular, unpopular 😢 ) takes place:
kibana/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.tsx
Lines 153 to 160 in bcbef78
This should be rewritten using in the way Lens works, which requests those fields from Elasticsearch, with the addition, that it should also work with virtual fields for our text based query initiative. With the merge of #137031 the function for getting this available fields will be migrated from server -> public.
Here's how it currently works in Lens:
kibana/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx
Lines 183 to 191 in 51816a0
The text was updated successfully, but these errors were encountered: