Skip to content

[Advanced Settings] Fix search does not work for terms with ":"#193506

Merged
ElenaStoeva merged 9 commits intoelastic:mainfrom
viajes7:fix/query_setting_fields
Sep 25, 2024
Merged

[Advanced Settings] Fix search does not work for terms with ":"#193506
ElenaStoeva merged 9 commits intoelastic:mainfrom
viajes7:fix/query_setting_fields

Conversation

@viajes7
Copy link
Copy Markdown
Contributor

@viajes7 viajes7 commented Sep 20, 2024

Summary

Fixes #192694

When terms with :, it will be transformed to a FieldClause.

So, I'm try to set it back to a TermClause if the field is not in FieldDefinition.

Example: -defaultValue:false doc_table:high Dashboard

image

@viajes7 viajes7 requested a review from a team as a code owner September 20, 2024 06:07
@viajes7
Copy link
Copy Markdown
Contributor Author

viajes7 commented Sep 20, 2024

@elasticmachine merge upstream

@viajes7 viajes7 changed the title [AdvancedSettings] Fix search does not work for terms with ":" [Advanced Settings] Fix search does not work for terms with ":" Sep 20, 2024
@alisonelizabeth alisonelizabeth added backport:prev-minor release_note:skip Skip the PR/issue when compiling release notes labels Sep 20, 2024
@alisonelizabeth
Copy link
Copy Markdown
Contributor

/ci

@viajes7
Copy link
Copy Markdown
Contributor Author

viajes7 commented Sep 21, 2024

@elasticmachine merge upstream

@viajes7
Copy link
Copy Markdown
Contributor Author

viajes7 commented Sep 23, 2024

@elasticmachine merge upstream

@viajes7
Copy link
Copy Markdown
Contributor Author

viajes7 commented Sep 23, 2024

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @viajes7! Tested locally and searching for settings that include : works well now. I have one suggestion regarding the check for the clause.

Comment thread packages/kbn-management/settings/application/hooks/use_fields.ts Outdated
@viajes7 viajes7 force-pushed the fix/query_setting_fields branch from 0840de1 to efc4981 Compare September 24, 2024 09:56
@viajes7
Copy link
Copy Markdown
Contributor Author

viajes7 commented Sep 24, 2024

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the changes!

@ElenaStoeva ElenaStoeva added Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// labels Sep 24, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@viajes7
Copy link
Copy Markdown
Contributor Author

viajes7 commented Sep 24, 2024

@ElenaStoeva Hi, I just pushed a commit, use the CATEGORY_FIELD constant. Please reivew the code(2a7f0b4).

On the other hand, docs-build-pr and kibana-ci need to be executed manually. Please have a look at it.

@ElenaStoeva
Copy link
Copy Markdown
Contributor

/ci

@ElenaStoeva
Copy link
Copy Markdown
Contributor

Hey @viajes7, thanks for using the CATEGORY_FIELD constant, latest changes lgtm!

Sure, I commented a prompt to re-run ci, hopefully it will pass this time.

@ElenaStoeva
Copy link
Copy Markdown
Contributor

/ci

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #4 / when rolling back to an older version kibana should detect that a later version alias exists, and abort

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
advancedSettings 36.8KB 37.0KB +180.0B

History

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

@delanni
Copy link
Copy Markdown
Member

delanni commented Sep 25, 2024

@elasticmachine run docs-build

@ElenaStoeva ElenaStoeva merged commit b8398c7 into elastic:main Sep 25, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 25, 2024
…tic#193506)

## Summary

Fixes elastic#192694

When terms with `:`, it will be transformed to a `FieldClause`.

So, I'm try to set it back to a `TermClause` if the field is not in
`FieldDefinition`.

Example: `-defaultValue:false doc_table:high Dashboard`

![image](https://github.com/user-attachments/assets/e9519cfe-c64d-4bd4-b928-d6ffd9bfaa8b)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
(cherry picked from commit b8398c7)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 25, 2024
…ot;:&quot; (#193506) (#193965)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Advanced Settings] Fix search does not work for terms with
&quot;:&quot; (#193506)](#193506)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Jusheng
Huang","email":"117657272+viajes7@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-25T10:36:25Z","message":"[Advanced
Settings] Fix search does not work for terms with \":\" (#193506)\n\n##
Summary\r\n\r\nFixes #192694\r\n\r\nWhen terms with `:`, it will be
transformed to a `FieldClause`.\r\n\r\nSo, I'm try to set it back to a
`TermClause` if the field is not
in\r\n`FieldDefinition`.\r\n\r\nExample: `-defaultValue:false
doc_table:high
Dashboard`\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e9519cfe-c64d-4bd4-b928-d6ffd9bfaa8b)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by: Elena
Stoeva
<59341489+ElenaStoeva@users.noreply.github.com>","sha":"b8398c7b684d9fb4745c0d9d8c5a9c60a5eddc48","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Kibana
Management","Team:Kibana
Management","release_note:skip","💝community","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Advanced
Settings] Fix search does not work for terms with
\":\"","number":193506,"url":"https://github.com/elastic/kibana/pull/193506","mergeCommit":{"message":"[Advanced
Settings] Fix search does not work for terms with \":\" (#193506)\n\n##
Summary\r\n\r\nFixes #192694\r\n\r\nWhen terms with `:`, it will be
transformed to a `FieldClause`.\r\n\r\nSo, I'm try to set it back to a
`TermClause` if the field is not
in\r\n`FieldDefinition`.\r\n\r\nExample: `-defaultValue:false
doc_table:high
Dashboard`\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e9519cfe-c64d-4bd4-b928-d6ffd9bfaa8b)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by: Elena
Stoeva
<59341489+ElenaStoeva@users.noreply.github.com>","sha":"b8398c7b684d9fb4745c0d9d8c5a9c60a5eddc48"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193506","number":193506,"mergeCommit":{"message":"[Advanced
Settings] Fix search does not work for terms with \":\" (#193506)\n\n##
Summary\r\n\r\nFixes #192694\r\n\r\nWhen terms with `:`, it will be
transformed to a `FieldClause`.\r\n\r\nSo, I'm try to set it back to a
`TermClause` if the field is not
in\r\n`FieldDefinition`.\r\n\r\nExample: `-defaultValue:false
doc_table:high
Dashboard`\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e9519cfe-c64d-4bd4-b928-d6ffd9bfaa8b)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>\r\nCo-authored-by: Elena
Stoeva
<59341489+ElenaStoeva@users.noreply.github.com>","sha":"b8398c7b684d9fb4745c0d9d8c5a9c60a5eddc48"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jusheng Huang <117657272+viajes7@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💝community Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AdvancedSettings] Search does not work for terms with ":"

7 participants