From cd63a218c79cd6de6983c98407a53e9cc399bfd1 Mon Sep 17 00:00:00 2001 From: Teddy Date: Thu, 24 Oct 2024 10:46:08 +0200 Subject: [PATCH] fix: added test case domain, tags and owners field to search incident index (#18380) --- .../TestCaseResolutionStatusIndex.java | 16 ++- ..._case_resolution_status_index_mapping.json | 116 ++++++++++++++++++ ..._case_resolution_status_index_mapping.json | 116 ++++++++++++++++++ ..._case_resolution_status_index_mapping.json | 116 ++++++++++++++++++ 4 files changed, 362 insertions(+), 2 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/TestCaseResolutionStatusIndex.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/TestCaseResolutionStatusIndex.java index acc49aba053..66dbf2c26d6 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/TestCaseResolutionStatusIndex.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/TestCaseResolutionStatusIndex.java @@ -46,9 +46,21 @@ public record TestCaseResolutionStatusIndex(TestCaseResolutionStatus testCaseRes private void setParentRelationships(Map doc) { // denormalize the parent relationships for search EntityReference testCaseReference = testCaseResolutionStatus.getTestCaseReference(); - TestCase testCase = Entity.getEntityOrNull(testCaseReference, "testSuite", Include.ALL); + TestCase testCase = + Entity.getEntityOrNull(testCaseReference, "testSuite,domain,tags,owners", Include.ALL); if (testCase == null) return; - doc.put("testCase", testCase.getEntityReference()); + testCase = + new TestCase() + .withId(testCase.getId()) + .withName(testCase.getName()) + .withFullyQualifiedName(testCase.getFullyQualifiedName()) + .withDescription(testCase.getDescription()) + .withDisplayName(testCase.getDisplayName()) + .withDeleted(testCase.getDeleted()) + .withDomain(testCase.getDomain()) + .withTags(testCase.getTags()) + .withOwners(testCase.getOwners()); + doc.put("testCase", testCase); TestSuite testSuite = Entity.getEntityOrNull(testCase.getTestSuite(), "", Include.ALL); if (testSuite == null) return; doc.put("testSuite", testSuite.getEntityReference()); diff --git a/openmetadata-service/src/main/resources/elasticsearch/en/test_case_resolution_status_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/en/test_case_resolution_status_index_mapping.json index 994cf40b65e..c24cc81b951 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/en/test_case_resolution_status_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/en/test_case_resolution_status_index_mapping.json @@ -669,6 +669,122 @@ }, "href": { "type": "text" + }, + "tags": { + "type": "nested", + "properties": { + "tagFQN": { + "type": "keyword" + }, + "labelType": { + "type": "keyword" + }, + "description": { + "type": "text", + "index_options": "docs" + }, + "source": { + "type": "keyword" + }, + "state": { + "type": "keyword" + } + } + }, + "owners": { + "properties": { + "id": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 36 + } + } + }, + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "displayName": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, + "fullyQualifiedName": { + "type": "text" + }, + "description": { + "type": "text" + }, + "deleted": { + "type": "boolean" + }, + "href": { + "type": "text" + } + } + }, + "domain" : { + "properties": { + "id": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 36 + } + } + }, + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, + "fullyQualifiedName": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "deleted": { + "type": "boolean" + }, + "href": { + "type": "text" + } + } } } } diff --git a/openmetadata-service/src/main/resources/elasticsearch/jp/test_case_resolution_status_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/jp/test_case_resolution_status_index_mapping.json index bb6df3452ef..fbfb896a403 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/jp/test_case_resolution_status_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/jp/test_case_resolution_status_index_mapping.json @@ -630,6 +630,122 @@ }, "href": { "type": "text" + }, + "tags": { + "type": "nested", + "properties": { + "tagFQN": { + "type": "keyword" + }, + "labelType": { + "type": "keyword" + }, + "description": { + "type": "text", + "index_options": "docs" + }, + "source": { + "type": "keyword" + }, + "state": { + "type": "keyword" + } + } + }, + "owners": { + "properties": { + "id": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 36 + } + } + }, + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "displayName": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, + "fullyQualifiedName": { + "type": "text" + }, + "description": { + "type": "text" + }, + "deleted": { + "type": "boolean" + }, + "href": { + "type": "text" + } + } + }, + "domain" : { + "properties": { + "id": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 36 + } + } + }, + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, + "fullyQualifiedName": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "deleted": { + "type": "boolean" + }, + "href": { + "type": "text" + } + } } } } diff --git a/openmetadata-service/src/main/resources/elasticsearch/zh/test_case_resolution_status_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/zh/test_case_resolution_status_index_mapping.json index 54443a06a8d..6e1418a549b 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/zh/test_case_resolution_status_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/zh/test_case_resolution_status_index_mapping.json @@ -620,6 +620,122 @@ }, "href": { "type": "text" + }, + "tags": { + "type": "nested", + "properties": { + "tagFQN": { + "type": "keyword" + }, + "labelType": { + "type": "keyword" + }, + "description": { + "type": "text", + "index_options": "docs" + }, + "source": { + "type": "keyword" + }, + "state": { + "type": "keyword" + } + } + }, + "owners": { + "properties": { + "id": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 36 + } + } + }, + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "displayName": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, + "fullyQualifiedName": { + "type": "text" + }, + "description": { + "type": "text" + }, + "deleted": { + "type": "boolean" + }, + "href": { + "type": "text" + } + } + }, + "domain" : { + "properties": { + "id": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 36 + } + } + }, + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, + "fullyQualifiedName": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "deleted": { + "type": "boolean" + }, + "href": { + "type": "text" + } + } } } }