API定义 |
APP_ERROR MultiSearch(std::vector<AscendIndexVStar*>& indexes, const AscendIndexSearchParams& params, bool merge) const; |
---|---|
功能描述 |
实现从多个AscendIndexVStar库执行特征向量查询的接口,根据输入的特征向量返回最相似的topK条特征距离及ID。 |
输入 |
std::vector<AscendIndexVStar*>& indexes:待执行检索的多个Index。 const AscendIndexSearchParams& params:检索参数,具体请参见12.5.13.6-AscendIndexSearchParams size_t n:查询的特征向量的条数。 std::vector<float>& queryData:特征向量数据。 int topK:需要返回的最近似的结果个数。 bool merge:是否需要合并多个Index上执行检索的结果 |
输出 |
std::vector<float>& dists:查询向量与距离最近的前“topK”个向量间的距离值。 std::vector<int64_t>& labels:查询的距离最近的前“topK”个向量的ID。 |
返回值 |
APP_ERROR:调用返回状态,具体请参见接口调用返回值参考。 |
约束说明 |
|