diff --git a/openmetadata-service/src/main/resources/json/data/searchSettings/searchSettings.json b/openmetadata-service/src/main/resources/json/data/searchSettings/searchSettings.json index 8a1c6ab9fa9..984e629b27a 100644 --- a/openmetadata-service/src/main/resources/json/data/searchSettings/searchSettings.json +++ b/openmetadata-service/src/main/resources/json/data/searchSettings/searchSettings.json @@ -1118,6 +1118,10 @@ { "field": "classification.name", "boost": 7.0 + }, + { + "field": "classification.displayName", + "boost": 7.0 } ], "aggregations": [ diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Tags.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Tags.spec.ts index 8949c4c7056..6334038d5c3 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Tags.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Tags.spec.ts @@ -437,3 +437,52 @@ test.fixme('Classification Page', async ({ page }) => { ).not.toBeVisible(); }); }); + +test('Search tag using classification display name should work', async ({ + page, +}) => { + const displayNameToSearch = tag.responseData.classification.displayName; + + await table.visitEntityPage(page); + + await page.waitForLoadState('networkidle'); + + const initialQueryResponse = page.waitForResponse('**/api/v1/search/query?*'); + + await page + .getByTestId('KnowledgePanel.Tags') + .getByTestId('tags-container') + .getByTestId('add-tag') + .first() + .click(); + + await initialQueryResponse; + + const tagSearchResponse = page.waitForResponse( + `/api/v1/search/query?q=*${encodeURIComponent(displayNameToSearch)}*` + ); + + // Enter the display name in the search box + await page.fill('[data-testid="tag-selector"] input', displayNameToSearch); + + const response = await tagSearchResponse; + const searchResults = await response.json(); + + // Verify that we got search results + expect(searchResults.hits.hits.length).toBeGreaterThan(0); + + // Verify that the classification display name is shown in search input + await expect( + page.locator('[data-testid="tag-selector"] > .ant-select-selector') + ).toContainText(displayNameToSearch); + + // Verify that the tag with matching display name is shown in dropdown + await expect( + page.locator('.ant-select-dropdown').getByText(tag.responseData.displayName) + ).toBeVisible(); + + // Verify the tag is selectable in the dropdown + await expect( + page.getByTestId(`tag-${tag.responseData.fullyQualifiedName}`) + ).toBeVisible(); +});