[Search Source] Do not pick scripted fields if * provided#85133
Merged
timroes merged 5 commits intoelastic:masterfrom Dec 9, 2020
Merged
[Search Source] Do not pick scripted fields if * provided#85133timroes merged 5 commits intoelastic:masterfrom
timroes merged 5 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/kibana-app-services (Team:AppServices) |
timroes
reviewed
Dec 7, 2020
Co-authored-by: Tim Roes <mail@timroes.de>
majagrubic
commented
Dec 8, 2020
Contributor
Author
majagrubic
left a comment
There was a problem hiding this comment.
Looks good and clean, but I can't approve cause I'm one of the contributors.
lukeelmers
approved these changes
Dec 8, 2020
Contributor
lukeelmers
left a comment
There was a problem hiding this comment.
Changes LGTM! Thanks for the update; I missed this use case in my original PR but I think this behavior makes the most sense.
lukasolson
approved these changes
Dec 8, 2020
Contributor
lukasolson
left a comment
There was a problem hiding this comment.
LGTM. Could we just add a comment here to explain that setting it to * will retrieve all fields (included scripted)?
Contributor
💚 Build SucceededMetrics [docs]Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Dec 9, 2020
…k-field-to-hot-phase * 'master' of github.com:elastic/kibana: (429 commits) simplify popover open state logic (elastic#85379) [Logs UI][Metrics UI] Move actions to the kibana header (elastic#84648) [Search Source] Do not pick scripted fields if * provided (elastic#85133) [Search] Session SO polling (elastic#84225) [Transform] Replace legacy elasticsearch client (elastic#84932) [Uptime]Refactor header and action menu (elastic#83779) Fix agg select external link (elastic#85380) [ILM] Show forcemerge in hot when rollover is searchable snapshot is enabled (elastic#85292) clear using keyboard (elastic#85042) [GS] add tag and dashboard suggestion results (elastic#85144) [ML] API integration tests - skip GetAnomaliesTableData Add ECS field for event.code. (elastic#85109) [Functional][TSVB] Wait for markdown textarea to be cleaned (elastic#85128) skip flaky suite (elastic#62060) skip flaky suite (elastic#85098) Bump highlight.js to v9.18.5 (elastic#84296) Add `server.publicBaseUrl` config (elastic#85075) [Alerting & Actions ] More debug logging (elastic#85149) [Security Solution][Case] Manual attach alert to a case (elastic#82996) Loosen UUID regex to accept uuidv1 or uuidv4 (elastic#85338) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index.ts # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts # x-pack/plugins/index_lifecycle_management/server/routes/api/policies/register_create_route.ts
timroes
pushed a commit
that referenced
this pull request
Dec 9, 2020
…85399) * [Search Source] Do not pick scripted fields if * provided * Update src/plugins/data/common/search/search_source/search_source.ts Co-authored-by: Tim Roes <mail@timroes.de> * Add unit test * Add documentation Co-authored-by: Tim Roes <mail@timroes.de> Co-authored-by: Maja Grubic <maja.grubic@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When building Discover to use Fields API, I noticed the script fields are not displayed. It is because when requesting the fields, I use a wildcard '*', to get all the fields. Scripted fields are initially correctly set in the request body of the search cource, but then there is this filtering according to the field names specified. And since '*' doesn’t correspond to any specific field name, the resulting scripted fields array is empty.
I think a simple solution would be not to this if '*' exists in the fields array.
Checklist
[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)[ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)[ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)[ ] This was checked for cross-browser compatibilityFor maintainers
[ ] This was checked for breaking API changes and was labeled appropriately