Skip to content

Commit

Permalink
fix preview not showing after changing index api
Browse files Browse the repository at this point in the history
Signed-off-by: ruiyi.jiang <[email protected]>
  • Loading branch information
shanghaikid committed Oct 16, 2023
1 parent 2e9e3e7 commit 11ec0c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/src/pages/preview/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ const Preview: FC<{
];
// get search params
const indexesInfo = await IndexHttp.getIndexInfo(collectionName);
const indexType =
indexesInfo.length == 0 ? 'FLAT' : indexesInfo[0]._indexType;
const vectorIndex = indexesInfo.filter(i => i._fieldName === anns_field)[0];

const indexType = indexesInfo.length == 0 ? 'FLAT' : vectorIndex._indexType;
const indexConfig = INDEX_CONFIG[indexType];
const metric_type =
indexesInfo.length === 0 ? 'L2' : indexesInfo[0]._metricType;
indexesInfo.length === 0 ? 'L2' : vectorIndex._metricType;
const searchParamKey = indexConfig.search[0];
const searchParamValue = DEFAULT_SEARCH_PARAM_VALUE_MAP[searchParamKey];
const searchParam = { [searchParamKey]: searchParamValue };
Expand Down

0 comments on commit 11ec0c2

Please sign in to comment.