[ACS-6427] Add search highlighting (#3637)

* [ACS-6427] Initial commit for search highlights

* [ACS-6427] Add correct highlighting config, handle highlights in search results

* [ACS-6427] CR fixes

* [ACS-6427] CR fix

* [ACS-6427] Locator fix

* [ACS-6427] E2E fix

---------

Co-authored-by: swapnil.verma <swapnil.verma@globallogic.com>
This commit is contained in:
MichalKinas
2024-02-15 16:26:09 +01:00
committed by GitHub
parent 60a4abaa55
commit 4766bfe707
12 changed files with 303 additions and 85 deletions

View File

@@ -178,6 +178,11 @@ describe('SearchComponent', () => {
expect(query).toBe(`(cm:name:"hello*" OR cm:title:"hello*")`);
});
it('should not apply suffix to the TEXT field for correct highlighting', () => {
const query = component.formatSearchQuery('hello', ['cm:name', 'TEXT']);
expect(query).toBe(`(cm:name:"hello*" OR TEXT:"hello")`);
});
it('should format user input as cm:name if configuration not provided', () => {
const query = component.formatSearchQuery('hello');
expect(query).toBe(`(cm:name:"hello*")`);