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/CSV Reporting] Nested field columns are missing leaf fields in CSV report #172236

Closed
davismcphee opened this issue Nov 30, 2023 · 1 comment · Fixed by #172240
Closed
Assignees
Labels
bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:Discover Discover Application impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@davismcphee
Copy link
Contributor

When generating a CSV report from Discover, nested field columns are missing most leaf fields in the generated CSV file. If no columns are selected, and therefore all columns are included in the report by default, nested fields appear as expected.

No columns selected:
working

Output:

"_id","_index","_score",user
1,"test-report-nested-fields",1,"{""sub4"":[""foo""],""sub2"":[""Smith""],""sub3"":[""2023-11-29T11:27:45.000Z""],""sub1"":[""John""]}"
2,"test-report-nested-fields",1,"{""sub4"":[""foo""],""sub5"":[""2023-11-29T11:33:45.000Z""],""sub2"":[""Smith""],""sub3"":[""2023-11-29T11:27:45.000Z""],""sub1"":[""John""]}"

Nested column selected:
broken

Output:

user
"{""sub3"":[""2023-11-29T11:27:45.000Z""]}"
"{""sub5"":[""2023-11-29T11:33:45.000Z""],""sub3"":[""2023-11-29T11:27:45.000Z""]}"

Test data:

PUT test-report-nested-fields
{
  "mappings": {
    "properties": {
      "user": {
        "type": "nested",
        "properties": {
          "sub1": { "type": "keyword" },
          "sub2": { "type": "keyword" },
          "sub3": { "type": "date" }, // date field
          "sub4": { "type": "keyword" },
          "sub5": { "type": "date" } // date field
        }
      }
    }
  }
}

PUT test-report-nested-fields/_doc/1
{
  "user" : {
      "sub1" : "John",
      "sub2" :  "Smith",
      "sub3": "2023-11-29T11:27:45", // is exported
      "sub4": "foo"
  }
}

PUT test-report-nested-fields/_doc/2
{
  "user" : {
      "sub1" : "John",
      "sub2" :  "Smith",
      "sub3": "2023-11-29T11:27:45", // is exported
      "sub4": "foo",
      "sub5": "2023-11-29T11:33:45" // is exported
  }
}
@davismcphee davismcphee added bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead loe:small Small Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Nov 30, 2023
@davismcphee davismcphee self-assigned this Nov 30, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

davismcphee added a commit that referenced this issue Nov 30, 2023
…reports (#172240)

## Summary

When we generate the parameters for the report, we add all of the
selected columns as entries in the search request `fields` array (or `*`
if none are selected, which is why this case works), but this doesn't
work for nested fields since [the fields API doesn't support nested
field
roots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):
>However, when the `fields` pattern targets the nested `user` field
directly, no values will be returned because the pattern doesn’t match
any leaf fields.

Instead we can detect nested fields and add them to the `fields` array
as `{nestedFieldName}.*`, ensuring that all of the leaf fields are
returned in the response.

Fixes #172236.

### Checklist

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
davismcphee added a commit to davismcphee/kibana that referenced this issue Dec 1, 2023
…reports (elastic#172240)

## Summary

When we generate the parameters for the report, we add all of the
selected columns as entries in the search request `fields` array (or `*`
if none are selected, which is why this case works), but this doesn't
work for nested fields since [the fields API doesn't support nested
field
roots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):
>However, when the `fields` pattern targets the nested `user` field
directly, no values will be returned because the pattern doesn’t match
any leaf fields.

Instead we can detect nested fields and add them to the `fields` array
as `{nestedFieldName}.*`, ensuring that all of the leaf fields are
returned in the response.

Fixes elastic#172236.

### Checklist

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit ab5ff9c)

# Conflicts:
#	x-pack/plugins/reporting/tsconfig.json
davismcphee added a commit to davismcphee/kibana that referenced this issue Dec 1, 2023
…reports (elastic#172240)

## Summary

When we generate the parameters for the report, we add all of the
selected columns as entries in the search request `fields` array (or `*`
if none are selected, which is why this case works), but this doesn't
work for nested fields since [the fields API doesn't support nested
field
roots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):
>However, when the `fields` pattern targets the nested `user` field
directly, no values will be returned because the pattern doesn’t match
any leaf fields.

Instead we can detect nested fields and add them to the `fields` array
as `{nestedFieldName}.*`, ensuring that all of the leaf fields are
returned in the response.

Fixes elastic#172236.

### Checklist

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit ab5ff9c)

# Conflicts:
#	src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts
#	src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts
#	x-pack/plugins/reporting/tsconfig.json
davismcphee added a commit that referenced this issue Dec 1, 2023
…in CSV reports (#172240) (#172336)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[Discover/CSV Reporting] Fix support for nested field columns in CSV
reports (#172240)](#172240)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Davis
McPhee","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-30T16:43:39Z","message":"[Discover/CSV
Reporting] Fix support for nested field columns in CSV reports
(#172240)\n\n## Summary\r\n\r\nWhen we generate the parameters for the
report, we add all of the\r\nselected columns as entries in the search
request `fields` array (or `*`\r\nif none are selected, which is why
this case works), but this doesn't\r\nwork for nested fields since [the
fields API doesn't support
nested\r\nfield\r\nroots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):\r\n>However,
when the `fields` pattern targets the nested `user` field\r\ndirectly,
no values will be returned because the pattern doesn’t match\r\nany leaf
fields.\r\n\r\nInstead we can detect nested fields and add them to the
`fields` array\r\nas `{nestedFieldName}.*`, ensuring that all of the
leaf fields are\r\nreturned in the response.\r\n\r\nFixes
#172236.\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[ ] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ab5ff9ca626baa90c3cc0e92813ff70cb5956e23","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-minor","backport:prev-MAJOR","v8.12.0"],"number":172240,"url":"https://github.com/elastic/kibana/pull/172240","mergeCommit":{"message":"[Discover/CSV
Reporting] Fix support for nested field columns in CSV reports
(#172240)\n\n## Summary\r\n\r\nWhen we generate the parameters for the
report, we add all of the\r\nselected columns as entries in the search
request `fields` array (or `*`\r\nif none are selected, which is why
this case works), but this doesn't\r\nwork for nested fields since [the
fields API doesn't support
nested\r\nfield\r\nroots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):\r\n>However,
when the `fields` pattern targets the nested `user` field\r\ndirectly,
no values will be returned because the pattern doesn’t match\r\nany leaf
fields.\r\n\r\nInstead we can detect nested fields and add them to the
`fields` array\r\nas `{nestedFieldName}.*`, ensuring that all of the
leaf fields are\r\nreturned in the response.\r\n\r\nFixes
#172236.\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[ ] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ab5ff9ca626baa90c3cc0e92813ff70cb5956e23"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172240","number":172240,"mergeCommit":{"message":"[Discover/CSV
Reporting] Fix support for nested field columns in CSV reports
(#172240)\n\n## Summary\r\n\r\nWhen we generate the parameters for the
report, we add all of the\r\nselected columns as entries in the search
request `fields` array (or `*`\r\nif none are selected, which is why
this case works), but this doesn't\r\nwork for nested fields since [the
fields API doesn't support
nested\r\nfield\r\nroots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):\r\n>However,
when the `fields` pattern targets the nested `user` field\r\ndirectly,
no values will be returned because the pattern doesn’t match\r\nany leaf
fields.\r\n\r\nInstead we can detect nested fields and add them to the
`fields` array\r\nas `{nestedFieldName}.*`, ensuring that all of the
leaf fields are\r\nreturned in the response.\r\n\r\nFixes
#172236.\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[ ] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ab5ff9ca626baa90c3cc0e92813ff70cb5956e23"}},{"url":"https://github.com/elastic/kibana/pull/172335","number":172335,"branch":"8.11","state":"OPEN"}]}]
BACKPORT-->
davismcphee added a commit that referenced this issue Dec 1, 2023
…in CSV reports (#172240) (#172335)

# Backport

This will backport the following commits from `main` to `8.11`:
- [[Discover/CSV Reporting] Fix support for nested field columns in CSV
reports (#172240)](#172240)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Davis
McPhee","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-30T16:43:39Z","message":"[Discover/CSV
Reporting] Fix support for nested field columns in CSV reports
(#172240)\n\n## Summary\r\n\r\nWhen we generate the parameters for the
report, we add all of the\r\nselected columns as entries in the search
request `fields` array (or `*`\r\nif none are selected, which is why
this case works), but this doesn't\r\nwork for nested fields since [the
fields API doesn't support
nested\r\nfield\r\nroots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):\r\n>However,
when the `fields` pattern targets the nested `user` field\r\ndirectly,
no values will be returned because the pattern doesn’t match\r\nany leaf
fields.\r\n\r\nInstead we can detect nested fields and add them to the
`fields` array\r\nas `{nestedFieldName}.*`, ensuring that all of the
leaf fields are\r\nreturned in the response.\r\n\r\nFixes
#172236.\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[ ] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ab5ff9ca626baa90c3cc0e92813ff70cb5956e23","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-minor","backport:prev-MAJOR","v8.12.0"],"number":172240,"url":"https://github.com/elastic/kibana/pull/172240","mergeCommit":{"message":"[Discover/CSV
Reporting] Fix support for nested field columns in CSV reports
(#172240)\n\n## Summary\r\n\r\nWhen we generate the parameters for the
report, we add all of the\r\nselected columns as entries in the search
request `fields` array (or `*`\r\nif none are selected, which is why
this case works), but this doesn't\r\nwork for nested fields since [the
fields API doesn't support
nested\r\nfield\r\nroots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):\r\n>However,
when the `fields` pattern targets the nested `user` field\r\ndirectly,
no values will be returned because the pattern doesn’t match\r\nany leaf
fields.\r\n\r\nInstead we can detect nested fields and add them to the
`fields` array\r\nas `{nestedFieldName}.*`, ensuring that all of the
leaf fields are\r\nreturned in the response.\r\n\r\nFixes
#172236.\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[ ] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ab5ff9ca626baa90c3cc0e92813ff70cb5956e23"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172240","number":172240,"mergeCommit":{"message":"[Discover/CSV
Reporting] Fix support for nested field columns in CSV reports
(#172240)\n\n## Summary\r\n\r\nWhen we generate the parameters for the
report, we add all of the\r\nselected columns as entries in the search
request `fields` array (or `*`\r\nif none are selected, which is why
this case works), but this doesn't\r\nwork for nested fields since [the
fields API doesn't support
nested\r\nfield\r\nroots](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#search-fields-nested):\r\n>However,
when the `fields` pattern targets the nested `user` field\r\ndirectly,
no values will be returned because the pattern doesn’t match\r\nany leaf
fields.\r\n\r\nInstead we can detect nested fields and add them to the
`fields` array\r\nas `{nestedFieldName}.*`, ensuring that all of the
leaf fields are\r\nreturned in the response.\r\n\r\nFixes
#172236.\r\n\r\n### Checklist\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard accessibility](https://webaim.org/techniques/keyboard/))\r\n-
[ ] Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))\r\n-
[ ] If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))\r\n-
[ ] This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ab5ff9ca626baa90c3cc0e92813ff70cb5956e23"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:Discover Discover Application impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants