diff --git a/changelogs/upcoming/7702.md b/changelogs/upcoming/7702.md new file mode 100644 index 00000000000..d89537dcc24 --- /dev/null +++ b/changelogs/upcoming/7702.md @@ -0,0 +1 @@ +- Updated `EuiSearchBar` to allow the `@` special character in query string searches diff --git a/src/components/search_bar/query/default_syntax.test.ts b/src/components/search_bar/query/default_syntax.test.ts index 7311fdeb56e..1303b93a6e2 100644 --- a/src/components/search_bar/query/default_syntax.test.ts +++ b/src/components/search_bar/query/default_syntax.test.ts @@ -871,12 +871,12 @@ describe('defaultSyntax', () => { }); test('special characters', () => { - const ast = defaultSyntax.parse('*_-:'); + const ast = defaultSyntax.parse('*_-:@'); const clauses = ast.getTermClauses(); expect(clauses).toEqual([ { type: 'term', - value: '*_-:', + value: '*_-:@', match: 'must', }, ]); diff --git a/src/components/search_bar/query/default_syntax.ts b/src/components/search_bar/query/default_syntax.ts index 4679a53e222..fb1abda17fb 100644 --- a/src/components/search_bar/query/default_syntax.ts +++ b/src/components/search_bar/query/default_syntax.ts @@ -169,7 +169,7 @@ word wordChar = alnum - / [-_*:/] + / [-_*:/@] / escapedChar / extendedGlyph