[Global Search, Saved Objects Management] Use new parse option to specify recognized fields#190464
Conversation
ffa8b77 to
a5a5be5
Compare
a5a5be5 to
7997583
Compare
|
/ci |
1 similar comment
|
/ci |
ba37dc5 to
4461eb8
Compare
|
/ci |
…ch specify how user will input filters
…f the raw search term
4461eb8 to
fbc5028
Compare
| const searchTerm = getSearchTerm(query); | ||
| const filterValues = applyAliases(getFieldValueMap(query), aliasMap); | ||
|
|
||
| const unknownFilters = [...filterValues.entries()] |
There was a problem hiding this comment.
In the previous code, nothing was handling the unknowns field from the result. This PR takes the opinion that pulling out unknown field clauses and making them unusable is not the user's intention.
| }); | ||
| }); | ||
|
|
||
| it('handles unknowns field clauses', () => { |
There was a problem hiding this comment.
See my comment below for explanation
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
TinaHeiligers
left a comment
There was a problem hiding this comment.
Works as expected and code looks fine.
LGTM
Yes, this is expected because Elasticsearch seems to be using the default analyzer that breaks down the input into individual terms and then searches for documents that contain any of those terms. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-standard-analyzer.html |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…cify recognized fields (elastic#190464) This PR adds a new option to the `SchemaType` interface for parsing a query from a search in EuiSearchBar. This new field controls how EuiSearchBar text is parsed into a Query object. It enables better accuracy in how search terms are parsed when they include a `:` character. ## Release note Fixed an issue when using search bars with a term that includes a colon `:` character. ## Summary Closes elastic#184496 Depends on elastic/eui#7960 **GLOBAL SEARCH: BEFORE**  **GLOBAL SEARCH: AFTER**  **SAVED OBJECTS MANAGEMENT: BEFORE**  **SAVED OBJECTS MANAGEMENT: AFTER**  **SAVED OBJECTS FINDER: BEFORE**  **SAVED OBJECTS FINDER: AFTER**  ## Checklist - [x] Ensure that filtering using `type:` and `tags:` still works (cherry picked from commit 460ca2a)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…to specify recognized fields (#190464) (#193448) # Backport This will backport the following commits from `main` to `8.x`: - [[Global Search, Saved Objects Management] Use new parse option to specify recognized fields (#190464)](#190464) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tim Sullivan","email":"tsullivan@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-19T16:02:45Z","message":"[Global Search, Saved Objects Management] Use new parse option to specify recognized fields (#190464)\n\nThis PR adds a new option to the `SchemaType` interface for parsing a\r\nquery from a search in EuiSearchBar. This new field controls how\r\nEuiSearchBar text is parsed into a Query object. It enables better\r\naccuracy in how search terms are parsed when they include a `:`\r\ncharacter.\r\n\r\n## Release note\r\nFixed an issue when using search bars with a term that includes a colon\r\n`:` character.\r\n\r\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/184496\r\nDepends on https://github.com/elastic/eui/pull/7960\r\n\r\n**GLOBAL SEARCH: BEFORE**\r\n\r\n\r\n\r\n**GLOBAL SEARCH: AFTER**\r\n\r\n\r\n\r\n**SAVED OBJECTS MANAGEMENT: BEFORE**\r\n\r\n\r\n\r\n**SAVED OBJECTS MANAGEMENT: AFTER**\r\n\r\n\r\n\r\n**SAVED OBJECTS FINDER: BEFORE**\r\n\r\n\r\n\r\n**SAVED OBJECTS FINDER: AFTER**\r\n\r\n\r\n\r\n## Checklist\r\n - [x] Ensure that filtering using `type:` and `tags:` still works","sha":"460ca2a83f0fd14b9d8c78c6b695e742c3f25930","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:SharedUX","v8.16.0","backport:version"],"title":"[Global Search, Saved Objects Management] Use new parse option to specify recognized fields","number":190464,"url":"https://github.com/elastic/kibana/pull/190464","mergeCommit":{"message":"[Global Search, Saved Objects Management] Use new parse option to specify recognized fields (#190464)\n\nThis PR adds a new option to the `SchemaType` interface for parsing a\r\nquery from a search in EuiSearchBar. This new field controls how\r\nEuiSearchBar text is parsed into a Query object. It enables better\r\naccuracy in how search terms are parsed when they include a `:`\r\ncharacter.\r\n\r\n## Release note\r\nFixed an issue when using search bars with a term that includes a colon\r\n`:` character.\r\n\r\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/184496\r\nDepends on https://github.com/elastic/eui/pull/7960\r\n\r\n**GLOBAL SEARCH: BEFORE**\r\n\r\n\r\n\r\n**GLOBAL SEARCH: AFTER**\r\n\r\n\r\n\r\n**SAVED OBJECTS MANAGEMENT: BEFORE**\r\n\r\n\r\n\r\n**SAVED OBJECTS MANAGEMENT: AFTER**\r\n\r\n\r\n\r\n**SAVED OBJECTS FINDER: BEFORE**\r\n\r\n\r\n\r\n**SAVED OBJECTS FINDER: AFTER**\r\n\r\n\r\n\r\n## Checklist\r\n - [x] Ensure that filtering using `type:` and `tags:` still works","sha":"460ca2a83f0fd14b9d8c78c6b695e742c3f25930"}},"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/190464","number":190464,"mergeCommit":{"message":"[Global Search, Saved Objects Management] Use new parse option to specify recognized fields (#190464)\n\nThis PR adds a new option to the `SchemaType` interface for parsing a\r\nquery from a search in EuiSearchBar. This new field controls how\r\nEuiSearchBar text is parsed into a Query object. It enables better\r\naccuracy in how search terms are parsed when they include a `:`\r\ncharacter.\r\n\r\n## Release note\r\nFixed an issue when using search bars with a term that includes a colon\r\n`:` character.\r\n\r\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/184496\r\nDepends on https://github.com/elastic/eui/pull/7960\r\n\r\n**GLOBAL SEARCH: BEFORE**\r\n\r\n\r\n\r\n**GLOBAL SEARCH: AFTER**\r\n\r\n\r\n\r\n**SAVED OBJECTS MANAGEMENT: BEFORE**\r\n\r\n\r\n\r\n**SAVED OBJECTS MANAGEMENT: AFTER**\r\n\r\n\r\n\r\n**SAVED OBJECTS FINDER: BEFORE**\r\n\r\n\r\n\r\n**SAVED OBJECTS FINDER: AFTER**\r\n\r\n\r\n\r\n## Checklist\r\n - [x] Ensure that filtering using `type:` and `tags:` still works","sha":"460ca2a83f0fd14b9d8c78c6b695e742c3f25930"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>

This PR adds a new option to the
SchemaTypeinterface for parsing a query from a search in EuiSearchBar. This new field controls how EuiSearchBar text is parsed into a Query object. It enables better accuracy in how search terms are parsed when they include a:character.Release note
Fixed an issue when using search bars with a term that includes a colon
:character.Summary
Closes #184496
Depends on elastic/eui#7960
GLOBAL SEARCH: BEFORE

GLOBAL SEARCH: AFTER

SAVED OBJECTS MANAGEMENT: BEFORE

SAVED OBJECTS MANAGEMENT: AFTER

SAVED OBJECTS FINDER: BEFORE

SAVED OBJECTS FINDER: AFTER

Checklist
type:andtags:still works