From 71dd2a24852a831d6235986255615c1e5d96eaa7 Mon Sep 17 00:00:00 2001 From: sonikashah Date: Tue, 17 Sep 2024 12:20:13 +0530 Subject: [PATCH] Show displayName for database and databaseSchema in explore tree --- .../elasticsearch/ElasticSearchClient.java | 8 ++++++++ .../search/opensearch/OpenSearchClient.java | 8 ++++++++ .../en/database_index_mapping.json | 10 ++++++++++ .../en/database_schema_index_mapping.json | 10 ++++++++++ .../en/stored_procedure_index_mapping.json | 2 ++ .../jp/database_index_mapping.json | 10 ++++++++++ .../jp/database_schema_index_mapping.json | 10 ++++++++++ .../jp/stored_procedure_index_mapping.json | 2 ++ .../elasticsearch/jp/table_index_mapping.json | 20 +++++++++++++++++++ .../zh/database_index_mapping.json | 10 ++++++++++ .../zh/database_schema_index_mapping.json | 10 ++++++++++ .../zh/stored_procedure_index_mapping.json | 2 ++ .../elasticsearch/zh/table_index_mapping.json | 20 +++++++++++++++++++ 13 files changed, 122 insertions(+) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java index 22a8399a6b1a..1fb21b3fee7c 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java @@ -1334,6 +1334,14 @@ private static SearchSourceBuilder buildSearchAcrossIndexesBuilder( AggregationBuilders.terms("databaseSchema.name.keyword") .field("databaseSchema.name.keyword") .size(MAX_AGGREGATE_SIZE)); + searchSourceBuilder.aggregation( + AggregationBuilders.terms("database.displayName") + .field("database.displayName") + .size(MAX_AGGREGATE_SIZE)); + searchSourceBuilder.aggregation( + AggregationBuilders.terms("databaseSchema.displayName") + .field("databaseSchema.displayName") + .size(MAX_AGGREGATE_SIZE)); return addAggregation(searchSourceBuilder); } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java index cfd64096999c..e4f7d8ccb9bd 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java @@ -1306,6 +1306,14 @@ private static SearchSourceBuilder buildSearchAcrossIndexesBuilder( AggregationBuilders.terms("databaseSchema.name.keyword") .field("databaseSchema.name.keyword") .size(MAX_AGGREGATE_SIZE)); + searchSourceBuilder.aggregation( + AggregationBuilders.terms("database.displayName") + .field("database.displayName") + .size(MAX_AGGREGATE_SIZE)); + searchSourceBuilder.aggregation( + AggregationBuilders.terms("databaseSchema.displayName") + .field("databaseSchema.displayName") + .size(MAX_AGGREGATE_SIZE)); return addAggregation(searchSourceBuilder); } diff --git a/openmetadata-service/src/main/resources/elasticsearch/en/database_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/en/database_index_mapping.json index 74771659c1c1..30d983d04844 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/en/database_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/en/database_index_mapping.json @@ -393,6 +393,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "text" }, diff --git a/openmetadata-service/src/main/resources/elasticsearch/en/database_schema_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/en/database_schema_index_mapping.json index 55c9088e0879..e21b08624333 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/en/database_schema_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/en/database_schema_index_mapping.json @@ -298,6 +298,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "keyword", "normalizer": "lowercase_normalizer" diff --git a/openmetadata-service/src/main/resources/elasticsearch/en/stored_procedure_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/en/stored_procedure_index_mapping.json index 2fef8e69dc5a..7175f4ebe7fe 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/en/stored_procedure_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/en/stored_procedure_index_mapping.json @@ -179,6 +179,7 @@ "fields": { "keyword": { "type": "keyword", + "normalizer": "lowercase_normalizer", "ignore_above": 256 } } @@ -225,6 +226,7 @@ "fields": { "keyword": { "type": "keyword", + "normalizer": "lowercase_normalizer", "ignore_above": 256 } } diff --git a/openmetadata-service/src/main/resources/elasticsearch/jp/database_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/jp/database_index_mapping.json index 69e8aed271fd..1614b4dd7d83 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/jp/database_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/jp/database_index_mapping.json @@ -402,6 +402,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "text" }, diff --git a/openmetadata-service/src/main/resources/elasticsearch/jp/database_schema_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/jp/database_schema_index_mapping.json index 9a1cd0f65626..f5d2d5f3b512 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/jp/database_schema_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/jp/database_schema_index_mapping.json @@ -307,6 +307,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "keyword", "normalizer": "lowercase_normalizer" diff --git a/openmetadata-service/src/main/resources/elasticsearch/jp/stored_procedure_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/jp/stored_procedure_index_mapping.json index 607435b948eb..69cec532a3a6 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/jp/stored_procedure_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/jp/stored_procedure_index_mapping.json @@ -185,6 +185,7 @@ "fields": { "keyword": { "type": "keyword", + "normalizer": "lowercase_normalizer", "ignore_above": 256 } } @@ -231,6 +232,7 @@ "fields": { "keyword": { "type": "keyword", + "normalizer": "lowercase_normalizer", "ignore_above": 256 } } diff --git a/openmetadata-service/src/main/resources/elasticsearch/jp/table_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/jp/table_index_mapping.json index cb77aef9f826..76e6674d4a86 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/jp/table_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/jp/table_index_mapping.json @@ -190,6 +190,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "text" }, @@ -228,6 +238,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "text" }, diff --git a/openmetadata-service/src/main/resources/elasticsearch/zh/database_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/zh/database_index_mapping.json index ae0d47b21e1e..e7eafeb1935b 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/zh/database_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/zh/database_index_mapping.json @@ -375,6 +375,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "text" }, diff --git a/openmetadata-service/src/main/resources/elasticsearch/zh/database_schema_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/zh/database_schema_index_mapping.json index e04ade9afbdf..8a6aea6c5d43 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/zh/database_schema_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/zh/database_schema_index_mapping.json @@ -282,6 +282,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "keyword", "normalizer": "lowercase_normalizer" diff --git a/openmetadata-service/src/main/resources/elasticsearch/zh/stored_procedure_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/zh/stored_procedure_index_mapping.json index 3cb9cbaeaefc..b8e5057fbc23 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/zh/stored_procedure_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/zh/stored_procedure_index_mapping.json @@ -165,6 +165,7 @@ "fields": { "keyword": { "type": "keyword", + "normalizer": "lowercase_normalizer", "ignore_above": 256 } } @@ -211,6 +212,7 @@ "fields": { "keyword": { "type": "keyword", + "normalizer": "lowercase_normalizer", "ignore_above": 256 } } diff --git a/openmetadata-service/src/main/resources/elasticsearch/zh/table_index_mapping.json b/openmetadata-service/src/main/resources/elasticsearch/zh/table_index_mapping.json index ab507c21bd0c..022b91d620ac 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/zh/table_index_mapping.json +++ b/openmetadata-service/src/main/resources/elasticsearch/zh/table_index_mapping.json @@ -164,6 +164,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "text" }, @@ -204,6 +214,16 @@ } } }, + "displayName": { + "type": "keyword", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase_normalizer", + "ignore_above": 256 + } + } + }, "fullyQualifiedName": { "type": "text" },