From e84de1a310d87cd3e48e7ebda7c688ac58906f68 Mon Sep 17 00:00:00 2001 From: Sriharsha Chintalapani Date: Wed, 29 Sep 2021 17:43:09 -0700 Subject: [PATCH] Fix #611: ElasticSearch matches are case-sensitive (#617) --- .../resources/search/SearchResource.java | 2 +- .../ingestion/sink/elasticsearch_constants.py | 25 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java index bc5255ef061..4ebecaf7b09 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java @@ -104,7 +104,7 @@ public class SearchResource { @DefaultValue("10") @QueryParam("size") int size, @Parameter(description = "Sort the search results by field, available fields to " + "sort weekly_stats" + - " , daily_stats, monthly_stats, last_updated_timestamp defaults to weekly_stats") + " , daily_stats, monthly_stats, last_updated_timestamp") @QueryParam("sort_field") String sortFieldParam, @Parameter(description = "Sort order asc for ascending or desc for descending, " + "defaults to desc") diff --git a/ingestion/src/metadata/ingestion/sink/elasticsearch_constants.py b/ingestion/src/metadata/ingestion/sink/elasticsearch_constants.py index 7ada28f5d80..8f83132e1e6 100644 --- a/ingestion/src/metadata/ingestion/sink/elasticsearch_constants.py +++ b/ingestion/src/metadata/ingestion/sink/elasticsearch_constants.py @@ -21,8 +21,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( "mappings":{ "properties": { "table_name": { - "type":"text", - "analyzer": "keyword" + "type":"text" }, "schema": { "type":"text", @@ -34,10 +33,10 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( } }, "display_name": { - "type": "keyword" + "type": "text" }, "owner": { - "type": "keyword" + "type": "text" }, "followers": { "type": "keyword" @@ -53,7 +52,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( "type": "keyword" }, "column_names": { - "type":"keyword" + "type":"text" }, "column_descriptions": { "type": "text" @@ -71,7 +70,7 @@ TABLE_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( "type": "keyword" }, "database": { - "type": "keyword" + "type": "text" }, "suggest": { "type": "completion" @@ -106,8 +105,7 @@ TOPIC_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( "mappings":{ "properties": { "topic_name": { - "type":"text", - "analyzer": "keyword" + "type":"text" }, "schema": { "type":"text", @@ -119,10 +117,10 @@ TOPIC_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( } }, "display_name": { - "type": "keyword" + "type": "text" }, "owner": { - "type": "keyword" + "type": "text" }, "followers": { "type": "keyword" @@ -161,11 +159,10 @@ DASHBOARD_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( "mappings":{ "properties": { "dashboard_name": { - "type":"text", - "analyzer": "keyword" + "type":"text" }, "display_name": { - "type": "keyword" + "type": "text" }, "owner": { "type": "keyword" @@ -181,7 +178,7 @@ DASHBOARD_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent( "type": "text" }, "chart_names": { - "type":"keyword" + "type":"text" }, "chart_descriptions": { "type": "text"