Skip to content
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] Remaining work on Fields API #88426

Closed
24 of 31 tasks
majagrubic opened this issue Jan 15, 2021 · 7 comments
Closed
24 of 31 tasks

[Discover] Remaining work on Fields API #88426

majagrubic opened this issue Jan 15, 2021 · 7 comments
Labels
Feature:Discover Discover Application Project:RuntimeFields roadmap Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@majagrubic
Copy link
Contributor

majagrubic commented Jan 15, 2021

7.12

In progress

  • Testing

Later

After removal of _source mode

The 7.12 experience

There are two modes, controlled by the "Read fields from _source" advanced setting (discover:searchFieldsFromSource). If that setting is "off" (default in 7.12) fields will be read using the fields API (also called fields mode below), if it's "on" _source will be used (also called source mode below).

  • Document/_source column:
    • source mode _source is an available column representing the _source of the field.
    • fields mode When the Fields API is used, the _source column is filtered from all views (in saved searches, default columns via advanced settings, ...). If _source was the only displayed column, it's replaced by the "Document" column showing all available fields in a flattened way
    • fields mode You can't mix the "document" column with other columns (as you can with source mode).
  • Runtime fields (defined on the mapping):
    • source mode will show up in the field list, but will always appear empty inside the documents in any of the discover apps, unless they are of type date or date_nanos in which case they will work fine even in source mode.
    • fields mode will work as any other indexed field
  • Unmapped fields:
    • source mode Unmapped fields will be shown (as they have been so far)
    • fields mode If fields API is used (the default), will be shown in the sidebar and in the documents. If source filtering (via the index pattern) is used, they won't show up anymore. In contrast to before unmapped leafs will be shown in the sidebar (see Discover: Leaves of disabled object fields are shown separately in the fields list #92019)
    • Future plans: We plan to remove unmapped fields completely in 8.0 and instead other technologies to access that data (like runtime fields) need to be used.
  • Object fields:
    • source mode Object fields (root and leaf fields) work as beforehand¹, only columns with array of objects will now be shown in one line instead of multi line JSON
    • fields mode Object roots won't be shown in the field list anymore (unless you have an old saved search containing one under "selected fields" so you can remove it). Leaf fields will now be correctly detected as having data, even when the document has an array of objects.
    • fields mode In the table root fields (which can only happen via manipulating the URL or opening existing saved searches which had them added) will be shown in a similar way to the "Document" field, i.e. a summary representation of that object:
      screenshot-20210222-142940
    • fields mode Leaf fields will be working for all objects and if the document contained an array of objects, show the values of all objects in that array flattened:
      screenshot-20210222-143036
  • Nested fields:
    • source mode Nested fields behave as beforehand. They behaved the same as object fields so far (see the footnote for more details).
    • fields mode The root of a nested field can be added from the field list and will show the structured JSON of that field in the document. Nested field columns now show the JSON correctly for all documents. Earlier it wouldn't show for documents that had only one object (instead of an array of objects) indexed into that field.
    • fields mode If you have a saved search with a nested leaf field as a column (which could have been possible earlier, if there was a document having only one nested document and not an array) this will show as empty now. We want to have this behavior going forward since we assume the nested mapping type is only used when you index an array of objects, since it otherwise does not make much sense to be used.

¹ The sidebar shows the object field (aka root) with an unknown icon if at least one document loaded has an array of objects for that object field, otherwise the root field won't be shown. The leaf fields will be shown with their correct field icons. Leaf fields that do not appear in any document or only in documents that have arrays of objects for this object field, will NOT appear in the field list unless "Hide missing fields" is switched off, e.g. in the screenshot below user.age which only appears in the first document that has an array of users will not appear in the field list by default. In the table root fields as columns will show the JSON of the fields content ONLY if that document contained an array of objects and will be empty otherwise. Leaf fields as columns will ONLY show values if the document did NOT contain an array of objects and stay empty otherwise:

screenshot-20210222-121550

Known issues 7.12

@timroes
Copy link
Contributor

timroes commented Feb 17, 2021

EOD Update 2021-02-17

Closed

New

@flash1293
Copy link
Contributor

flash1293 commented Feb 18, 2021

EOD Update 2021-02-18

Closed

Added to 7.12 list

  • "Show unmapped fields" on by default (without visible switch)
  • Add back "Hide missing fields" switch @wylieconlon
  • Disable source fetching ui setting on 7.12 and 7.x branch (to default to loading via fields API)
  • Timeboxed: Reconstruct object root fields as columns in the data grid

PRs:
https://github.com/elastic/kibana/pulls?q=is%3Apr+is%3Aclosed+label%3AFeature%3ADiscover+sort%3Aupdated-desc++merged%3A%3E%3D2021-02-18+

@flash1293
Copy link
Contributor

flash1293 commented Feb 19, 2021

Update 2021-02-19

New

Closed

PRs:
https://github.com/elastic/kibana/pulls?q=is%3Apr+is%3Aclosed+label%3AFeature%3ADiscover+sort%3Aupdated-desc++merged%3A%3E%3D2021-02-19+

@timroes
Copy link
Contributor

timroes commented Feb 22, 2021

Update 2021-02-22

New

  • Filter list shows all fields, although they are not present in the field list -> confusing behavior

Closed

Merged PRs

@flash1293
Copy link
Contributor

flash1293 commented Feb 23, 2021

Update 2021-02-23

New

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@timroes
Copy link
Contributor

timroes commented Aug 18, 2021

Going to close this, since we've introduced the fields API across Discover and will track other issues that might come up individually.

@timroes timroes closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application Project:RuntimeFields roadmap Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants