Skip to content

Commit d17d3ba

Browse files
authored
fix: level search parameter is for zilliz cloud only (#934)
Signed-off-by: ryjiang <jiangruiyi@gmail.com>
1 parent 342cf19 commit d17d3ba

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

client/src/pages/databases/collections/search/Search.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
useCallback,
66
useEffect,
77
useRef,
8+
useContext,
89
} from 'react';
910
import { Typography, AccordionSummary, Checkbox } from '@mui/material';
1011
import { useTranslation } from 'react-i18next';
@@ -58,6 +59,7 @@ import {
5859
CheckboxRow,
5960
LeftSection,
6061
} from './StyledComponents';
62+
import { authContext } from '@/context/Auth';
6163

6264
export interface CollectionDataProps {
6365
collectionName: string;
@@ -72,6 +74,9 @@ const emptyExplorerData: GraphData = {
7274
};
7375

7476
const Search = (props: CollectionDataProps) => {
77+
// context
78+
const { isManaged } = useContext(authContext);
79+
7580
// props
7681
const { collections, collectionName, searchParams, setSearchParams } = props;
7782
const collection = collections.find(
@@ -507,6 +512,7 @@ const Search = (props: CollectionDataProps) => {
507512
}) => {
508513
updateSearchParamCallback(updates as any, index);
509514
}}
515+
isManaged={isManaged}
510516
/>
511517
</StyledAccordionDetails>
512518
</StyledAccordion>

client/src/pages/databases/collections/search/SearchParams.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const SearchParams: FC<SearchParamsProps> = ({
1111
indexType = '',
1212
searchParamsForm,
1313
handleFormChange,
14+
isManaged,
1415
sx = {},
1516
}) => {
1617
// Get search params and their configs based on index type
@@ -35,7 +36,7 @@ const SearchParams: FC<SearchParamsProps> = ({
3536
},
3637
};
3738

38-
if (indexType === 'AUTOINDEX') {
39+
if (indexType === 'AUTOINDEX' && isManaged) {
3940
commonParams.level = {
4041
label: 'level',
4142
key: 'level',

client/src/pages/databases/collections/search/Types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface SearchParamsProps {
1212
[key in string]: number | string | boolean;
1313
}) => void;
1414
sx?: SxProps<Theme>;
15+
isManaged: boolean;
1516
}
1617

1718
export interface SearchResultView {

0 commit comments

Comments
 (0)