From 7f0448ebafe15bcc44811ecabaa4da727cbd0f1d Mon Sep 17 00:00:00 2001 From: abhishek332 Date: Fri, 9 Feb 2024 15:43:43 +0530 Subject: [PATCH 1/2] added re-run search indexing banner for es exception --- .../main/resources/ui/src/constants/explore.constants.ts | 3 +++ .../ui/src/pages/ExplorePage/ExplorePageV1.component.tsx | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts index 2964674fa30c..6d32fcfa1f32 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts @@ -91,4 +91,7 @@ export const COMMON_FILTERS_FOR_DIFFERENT_TABS = [ export const FAILED_TO_FIND_INDEX_ERROR = 'Failed to to find index'; +export const ES_EXCEPTION_SHARDS_FAILED = + 'Search failed due to Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]'; + export const SEARCH_INDEXING_APPLICATION = 'SearchIndexingApplication'; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx index ebab5e90714a..d69241e46657 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx @@ -36,6 +36,7 @@ import { useTourProvider } from '../../components/TourProvider/TourProvider'; import { getExplorePath, PAGE_SIZE } from '../../constants/constants'; import { COMMON_FILTERS_FOR_DIFFERENT_TABS, + ES_EXCEPTION_SHARDS_FAILED, FAILED_TO_FIND_INDEX_ERROR, INITIAL_SORT_FIELD, } from '../../constants/explore.constants'; @@ -393,7 +394,10 @@ const ExplorePageV1: FunctionComponent = () => { }), ]) .catch((error) => { - if (error.response?.data.message.includes(FAILED_TO_FIND_INDEX_ERROR)) { + if ( + error.response?.data.message.includes(FAILED_TO_FIND_INDEX_ERROR) || + error.response?.data.message === ES_EXCEPTION_SHARDS_FAILED + ) { setShowIndexNotFoundAlert(true); } else { showErrorToast(error); From 573911ff161f89436b15d599397511aea2e3d652 Mon Sep 17 00:00:00 2001 From: abhishek332 Date: Fri, 9 Feb 2024 17:49:01 +0530 Subject: [PATCH 2/2] minor change --- .../src/main/resources/ui/src/constants/explore.constants.ts | 3 +-- .../ui/src/pages/ExplorePage/ExplorePageV1.component.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts index 6d32fcfa1f32..1dc775289b4d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/explore.constants.ts @@ -91,7 +91,6 @@ export const COMMON_FILTERS_FOR_DIFFERENT_TABS = [ export const FAILED_TO_FIND_INDEX_ERROR = 'Failed to to find index'; -export const ES_EXCEPTION_SHARDS_FAILED = - 'Search failed due to Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]'; +export const ES_EXCEPTION_SHARDS_FAILED = 'reason=all shards failed'; export const SEARCH_INDEXING_APPLICATION = 'SearchIndexingApplication'; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx index d69241e46657..a4832cf2403d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ExplorePage/ExplorePageV1.component.tsx @@ -396,7 +396,7 @@ const ExplorePageV1: FunctionComponent = () => { .catch((error) => { if ( error.response?.data.message.includes(FAILED_TO_FIND_INDEX_ERROR) || - error.response?.data.message === ES_EXCEPTION_SHARDS_FAILED + error.response?.data.message.includes(ES_EXCEPTION_SHARDS_FAILED) ) { setShowIndexNotFoundAlert(true); } else {