mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 19:18:05 +00:00
added index attribute to search data to differentiate entities (#414)
This commit is contained in:
parent
657962bc4f
commit
f0a7ef50f0
@ -20,7 +20,6 @@ import { FormatedTableData } from 'Models';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { ReactNode } from 'react';
|
||||
import { PAGE_SIZE } from '../../constants/constants';
|
||||
import { SearchIndex } from '../../enums/search.enum';
|
||||
import { pluralize } from '../../utils/CommonUtils';
|
||||
import {
|
||||
getOwnerFromId,
|
||||
@ -43,7 +42,6 @@ type SearchedDataProp = {
|
||||
showResultCount?: boolean;
|
||||
searchText?: string;
|
||||
showOnboardingTemplate?: boolean;
|
||||
indexType?: string;
|
||||
};
|
||||
const SearchedData: React.FC<SearchedDataProp> = ({
|
||||
children,
|
||||
@ -56,7 +54,6 @@ const SearchedData: React.FC<SearchedDataProp> = ({
|
||||
searchText,
|
||||
totalValue,
|
||||
fetchLeftPanel,
|
||||
indexType = SearchIndex.TABLE,
|
||||
}: SearchedDataProp) => {
|
||||
const highlightSearchResult = () => {
|
||||
return data.map((table, index) => {
|
||||
@ -73,7 +70,7 @@ const SearchedData: React.FC<SearchedDataProp> = ({
|
||||
<TableDataCard
|
||||
description={description}
|
||||
fullyQualifiedName={table.fullyQualifiedName}
|
||||
indexType={indexType}
|
||||
indexType={table.index}
|
||||
name={name}
|
||||
owner={getOwnerFromId(table.owner)?.name}
|
||||
serviceType={table.serviceType || '--'}
|
||||
|
||||
@ -212,6 +212,7 @@ declare module 'Models' {
|
||||
description: string[];
|
||||
table_name: string[];
|
||||
};
|
||||
index: string;
|
||||
};
|
||||
|
||||
export type NewUser = {
|
||||
|
||||
@ -484,7 +484,6 @@ const ExplorePage: React.FC = (): React.ReactElement => {
|
||||
currentPage={currentPage}
|
||||
data={data}
|
||||
fetchLeftPanel={fetchLeftPanel}
|
||||
indexType={searchIndex}
|
||||
isLoading={isLoading}
|
||||
paginate={paginate}
|
||||
searchText={searchText}
|
||||
|
||||
@ -6,6 +6,7 @@ import { getRelativeTime } from './TimeUtils';
|
||||
export const formatDataResponse = (hits) => {
|
||||
const formattedData = hits.map((hit) => {
|
||||
const newData = {};
|
||||
newData.index = hit._index;
|
||||
newData.id =
|
||||
hit._source.table_id || hit._source.topic_id || hit._source.dashboard_id;
|
||||
newData.name =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user