Procházet zdrojové kódy

fix search result missing score

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
ruiyi.jiang před 1 rokem
rodič
revize
68696da9f5
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. 2 3
      client/src/pages/search/VectorSearch.tsx

+ 2 - 3
client/src/pages/search/VectorSearch.tsx

@@ -121,7 +121,7 @@ const VectorSearch = () => {
     return fields.find(f => f._isPrimaryKey)?._fieldName;
   }, [selectedCollection, collections]);
 
-  const orderArray = ['id', 'distance', ...outputFields];
+  const orderArray = [primaryKeyField, 'id', 'score', ...outputFields];
 
   const colDefinitions: ColDefinitionsType[] = useMemo(() => {
     /**
@@ -138,8 +138,7 @@ const VectorSearch = () => {
           })
           .filter(item => {
             // if primary key field name is id, don't filter it
-            const invalidItems =
-              primaryKeyField === 'id' ? ['score'] : ['id', 'score'];
+            const invalidItems = primaryKeyField === 'id' ? [] : ['id'];
             return !invalidItems.includes(item);
           })
           .map(key => ({