Skip to content

Commit

Permalink
fix search result missing score
Browse files Browse the repository at this point in the history
Signed-off-by: ruiyi.jiang <[email protected]>
  • Loading branch information
shanghaikid committed Aug 3, 2023
1 parent 342a503 commit 68696da
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/src/pages/search/VectorSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
/**
Expand All @@ -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 => ({
Expand Down

0 comments on commit 68696da

Please sign in to comment.