下载
中文
注册

AddWithIds

API定义

APP_ERROR AddWithIds(const std::vector<float>& baseData, const std::vector<int64_t>& ids);

功能描述

实现AscendIndexVStar建库和往底库中添加新的特征向量的功能。允许用户指定添加底库的ID。

输入

const std::vector<float>& baseData:待添加进底库的特征向量。

const std::vector<int64_t>& ids:待添加底库映射ID的数组。

输出

返回值

APP_ERROR:调用返回状态,具体请参见接口调用返回值参考

约束说明

  • “baseData”长度应该为n * dim,n为待添加进底库的向量数量,dim为向量维度。
  • “ids”长度必须为n,用户需要根据自己的业务场景,保证“ids”的合法性,如底库中存在重复的ID,检索结果中的"label"将无法对应具体的底库向量。
  • n∈[10000,1e8]。