Browse Source

fix: `level` search parameter is for zilliz cloud only (#934)

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 week ago
parent
commit
d17d3ba2b9

+ 6 - 0
client/src/pages/databases/collections/search/Search.tsx

@@ -5,6 +5,7 @@ import {
   useCallback,
   useCallback,
   useEffect,
   useEffect,
   useRef,
   useRef,
+  useContext,
 } from 'react';
 } from 'react';
 import { Typography, AccordionSummary, Checkbox } from '@mui/material';
 import { Typography, AccordionSummary, Checkbox } from '@mui/material';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
@@ -58,6 +59,7 @@ import {
   CheckboxRow,
   CheckboxRow,
   LeftSection,
   LeftSection,
 } from './StyledComponents';
 } from './StyledComponents';
+import { authContext } from '@/context/Auth';
 
 
 export interface CollectionDataProps {
 export interface CollectionDataProps {
   collectionName: string;
   collectionName: string;
@@ -72,6 +74,9 @@ const emptyExplorerData: GraphData = {
 };
 };
 
 
 const Search = (props: CollectionDataProps) => {
 const Search = (props: CollectionDataProps) => {
+  // context
+  const { isManaged } = useContext(authContext);
+
   // props
   // props
   const { collections, collectionName, searchParams, setSearchParams } = props;
   const { collections, collectionName, searchParams, setSearchParams } = props;
   const collection = collections.find(
   const collection = collections.find(
@@ -507,6 +512,7 @@ const Search = (props: CollectionDataProps) => {
                         }) => {
                         }) => {
                           updateSearchParamCallback(updates as any, index);
                           updateSearchParamCallback(updates as any, index);
                         }}
                         }}
+                        isManaged={isManaged}
                       />
                       />
                     </StyledAccordionDetails>
                     </StyledAccordionDetails>
                   </StyledAccordion>
                   </StyledAccordion>

+ 2 - 1
client/src/pages/databases/collections/search/SearchParams.tsx

@@ -11,6 +11,7 @@ const SearchParams: FC<SearchParamsProps> = ({
   indexType = '',
   indexType = '',
   searchParamsForm,
   searchParamsForm,
   handleFormChange,
   handleFormChange,
+  isManaged,
   sx = {},
   sx = {},
 }) => {
 }) => {
   // Get search params and their configs based on index type
   // Get search params and their configs based on index type
@@ -35,7 +36,7 @@ const SearchParams: FC<SearchParamsProps> = ({
       },
       },
     };
     };
 
 
-    if (indexType === 'AUTOINDEX') {
+    if (indexType === 'AUTOINDEX' && isManaged) {
       commonParams.level = {
       commonParams.level = {
         label: 'level',
         label: 'level',
         key: 'level',
         key: 'level',

+ 1 - 0
client/src/pages/databases/collections/search/Types.ts

@@ -12,6 +12,7 @@ export interface SearchParamsProps {
     [key in string]: number | string | boolean;
     [key in string]: number | string | boolean;
   }) => void;
   }) => void;
   sx?: SxProps<Theme>;
   sx?: SxProps<Theme>;
+  isManaged: boolean;
 }
 }
 
 
 export interface SearchResultView {
 export interface SearchResultView {