From b80c90dbee3147005331c285b8a81257213800d6 Mon Sep 17 00:00:00 2001 From: shanghaikid Date: Mon, 21 Nov 2022 16:47:33 +0800 Subject: [PATCH 1/2] fix #121 --- client/src/pages/preview/Preview.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/pages/preview/Preview.tsx b/client/src/pages/preview/Preview.tsx index 3778ca57..ddee5560 100644 --- a/client/src/pages/preview/Preview.tsx +++ b/client/src/pages/preview/Preview.tsx @@ -11,6 +11,7 @@ import { ToolBarConfig } from '../../components/grid/Types'; import CustomToolBar from '../../components/grid/ToolBar'; import { DataTypeStringEnum } from '../collections/Types'; import { generateVector } from '../../utils/Common'; +import { DataTypeEnum } from '../../pages/collections/Types'; import { INDEX_CONFIG, @@ -92,7 +93,7 @@ const Preview: FC<{ const anns_field = vectorField?._fieldName!; const dim = Number(vectorField?._dimension); - const vectors = [generateVector(dim)]; + const vectors = [generateVector(Number(dim))]; // get search params const indexesInfo = await IndexHttp.getIndexInfo(collectionName); const indexType = @@ -128,7 +129,7 @@ const Preview: FC<{ expr: '', vectors, output_fields: [primaryKey], - vector_type: Number(vectorField?._fieldId), + vector_type: DataTypeEnum[vectorField!._fieldType], }); // compose random id list expression From d42751a5c0241fee05d311a34714a52c38410958 Mon Sep 17 00:00:00 2001 From: shanghaikid Date: Mon, 21 Nov 2022 16:48:57 +0800 Subject: [PATCH 2/2] fix --- client/src/pages/preview/Preview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/preview/Preview.tsx b/client/src/pages/preview/Preview.tsx index ddee5560..dc8089a3 100644 --- a/client/src/pages/preview/Preview.tsx +++ b/client/src/pages/preview/Preview.tsx @@ -93,7 +93,7 @@ const Preview: FC<{ const anns_field = vectorField?._fieldName!; const dim = Number(vectorField?._dimension); - const vectors = [generateVector(Number(dim))]; + const vectors = [generateVector(dim)]; // get search params const indexesInfo = await IndexHttp.getIndexInfo(collectionName); const indexType =