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] Fix _source fields of objects formatting #136473

Merged
merged 4 commits into from
Jul 20, 2022

Conversation

dimaanj
Copy link
Contributor

@dimaanj dimaanj commented Jul 15, 2022

Summary

Fixes #123169, #127899

Before:
Bildschirmfoto 2022-07-19 um 18 56 16

After:
Bildschirmfoto 2022-07-19 um 19 03 08

Test:

  1. You need to enable discover:searchFieldsFromSource in Advanced settings

Bildschirmfoto 2022-07-19 um 19 08 34

  1. Go to dev tools and use the following data to create documents
PUT actionindex
{
  "mappings": {
    "properties": {
     "action": {
                "properties": {
                    "detail": {
                        "type": "text",
                        "fields": {
                            "keyword": {
                                "type": "keyword"
                            }
                        }
                    },
                    "endpoint": {
                        "type": "keyword"
                    },
                    "method": {
                        "type": "keyword"
                    }
                }
            }
  } 
    }
}

POST actionindex/_doc
{
  "action": {
    "detail": "a test",
    "endpoint": "the_endpoint",
    "method": "the_method"
  }
} 
  1. Create an data view in management and use in in Discover

  2. When expanding a document action looks like this:

Bildschirmfoto 2022-01-17 um 16 18 58

Checklist

@dimaanj dimaanj added Feature:Discover Discover Application release_note:fix Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) v8.4.0 v7.17.6 labels Jul 15, 2022
@dimaanj dimaanj self-assigned this Jul 15, 2022
@dimaanj dimaanj requested a review from a team July 15, 2022 14:25
@dimaanj dimaanj marked this pull request as ready for review July 15, 2022 14:27
@dimaanj dimaanj requested review from a team as code owners July 15, 2022 14:27
@elasticmachine
Copy link
Contributor

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

@dimaanj
Copy link
Contributor Author

dimaanj commented Jul 16, 2022

@elasticmachine merge upstream

@dimaanj
Copy link
Contributor Author

dimaanj commented Jul 19, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 423.6KB 423.6KB -14.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @dimaanj

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dimaanj thx a lot for fixing this, 2 flies (issues) with 1 stone(PR) 👍 , tested locally with the demo data, 2 issues fixed, works as expected

@kertal kertal added the auto-backport Deprecated - use backport:version if exact versions are needed label Jul 20, 2022
@kertal kertal added v8.3.3 and removed v8.3.3 labels Jul 20, 2022
@kertal kertal merged commit 0c78f8a into elastic:main Jul 20, 2022
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
7.17 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 136473

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 22, 2022
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 136473 locally

dimaanj added a commit to dimaanj/kibana that referenced this pull request Jul 25, 2022
- when fetching _source nested objects like obj.rootKey.subkey1, object.rootKey.subkey2 were not flattened correctly

(cherry picked from commit 0c78f8a)

# Conflicts:
#	x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap
@dimaanj
Copy link
Contributor Author

dimaanj commented Jul 25, 2022

💚 All backports created successfully

Status Branch Result
7.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

dimaanj added a commit that referenced this pull request Jul 25, 2022
… (#137040)

* [Discover] Fix flattening of _source fields of objects (#136473)

- when fetching _source nested objects like obj.rootKey.subkey1, object.rootKey.subkey2 were not flattened correctly

(cherry picked from commit 0c78f8a)

# Conflicts:
#	x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/download_csv_dashboard.snap

* [Discover] update snapshot
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Discover Discover Application release_note:fix Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) v7.17.6 v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover] Using _source fields of objects are no longer displayed separately
6 participants