From ab5c5799a9c58662641b9150e08d81d2738bf3e2 Mon Sep 17 00:00:00 2001 From: ryjiang Date: Thu, 19 Jun 2025 16:47:06 +0800 Subject: [PATCH] fix: entering text in the search input box is very laggy Signed-off-by: ryjiang --- .../databases/collections/search/Search.tsx | 50 ++++++------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/client/src/pages/databases/collections/search/Search.tsx b/client/src/pages/databases/collections/search/Search.tsx index 850598c9..d7f8794e 100644 --- a/client/src/pages/databases/collections/search/Search.tsx +++ b/client/src/pages/databases/collections/search/Search.tsx @@ -4,7 +4,6 @@ import { useTranslation } from 'react-i18next'; import { DataService, CollectionService } from '@/http'; import Icons from '@/components/icons/Icons'; import AttuGrid from '@/components/grid/Grid'; -import Filter from '@/components/advancedSearch'; import EmptyCard from '@/components/cards/EmptyCard'; import CustomButton from '@/components/customButton/CustomButton'; import { getLabelDisplayedRows } from '@/pages/search/Utils'; @@ -13,7 +12,7 @@ import SearchGlobalParams from './SearchGlobalParams'; import VectorInputBox from './SearchInputBox'; import StatusIcon, { LoadingType } from '@/components/status/StatusIcon'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import CustomInput from '@/components/customInput/CustomInput'; +import OptimizedInput from '../data/OptimizedInput'; import PartitionsSelector from './PartitionsSelector'; import { formatFieldType, @@ -21,7 +20,6 @@ import { generateVectorsByField, saveCsvAs, buildSearchParams, - getColumnWidth, } from '@/utils'; import SearchParams from './SearchParams'; import DataExplorer, { formatMilvusData } from './DataExplorer'; @@ -527,40 +525,20 @@ const Search = (props: CollectionDataProps) => {
- { - onFilterChange(value); - }} - showTooltip={false} - /> - ), - }, - onKeyDown: (e: any) => { - if (e.key === 'Enter') { - e.preventDefault(); - onSearchClicked(); - } - }, + { + if (e.key === 'Enter') { + e.preventDefault(); + onSearchClicked(); + } + }} + disabled={explorerOpen} + fields={collection.schema.scalarFields} + onSubmit={(expression: string) => { + onFilterChange(expression); }} - checkValid={() => true} />