mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-17 11:43:54 +00:00
fix: exception on global search sometimes (#14455)
This commit is contained in:
parent
3a51f0b7c2
commit
c9a00f343f
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
import { SortingField } from '../components/Explore/SortingDropDown';
|
||||
import { SearchIndex } from '../enums/search.enum';
|
||||
import i18n from '../utils/i18next/LocalUtil';
|
||||
|
||||
export const INITIAL_SORT_FIELD = 'updatedAt';
|
||||
@ -57,3 +58,18 @@ export const COMMON_FILTERS_FOR_DIFFERENT_TABS = [
|
||||
'owner.displayName',
|
||||
'tags.tagFQN',
|
||||
];
|
||||
|
||||
export const TABS_SEARCH_INDEXES = [
|
||||
SearchIndex.TABLE,
|
||||
SearchIndex.STORED_PROCEDURE,
|
||||
SearchIndex.DASHBOARD,
|
||||
SearchIndex.DASHBOARD_DATA_MODEL,
|
||||
SearchIndex.PIPELINE,
|
||||
SearchIndex.TOPIC,
|
||||
SearchIndex.MLMODEL,
|
||||
SearchIndex.CONTAINER,
|
||||
SearchIndex.SEARCH_INDEX,
|
||||
SearchIndex.GLOSSARY,
|
||||
SearchIndex.TAG,
|
||||
SearchIndex.DATA_PRODUCT,
|
||||
];
|
||||
|
@ -38,6 +38,7 @@ import { getExplorePath, PAGE_SIZE } from '../../constants/constants';
|
||||
import {
|
||||
COMMON_FILTERS_FOR_DIFFERENT_TABS,
|
||||
INITIAL_SORT_FIELD,
|
||||
TABS_SEARCH_INDEXES,
|
||||
} from '../../constants/explore.constants';
|
||||
import {
|
||||
mockSearchData,
|
||||
@ -341,8 +342,9 @@ const ExplorePageV1: FunctionComponent = () => {
|
||||
}).then((res) => {
|
||||
const buckets = res.aggregations[`index_count`].buckets;
|
||||
const counts: Record<string, number> = {};
|
||||
|
||||
buckets.forEach((item) => {
|
||||
if (item) {
|
||||
if (item && TABS_SEARCH_INDEXES.includes(item.key)) {
|
||||
counts[item.key ?? ''] = item.doc_count;
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user