AscendIndexSearchParams

API definition

AscendIndexSearchParams(size_t n, std::vector<float>& queryData, int topK, std::vector<float>& dists, std::vector<int64_t>& labels);

Function

Structure of the search parameter.

Input

N/A

Output

N/A

Value

size_t n: number of feature vectors to be queried.

std::vector<float>& queryData: feature vector data.

int topK: number of the most similar results to be returned.

std::vector<float>& dists: distance between a vector and the topK nearest vectors.

std::vector<int64_t>& labels: IDs of the topK nearest vectors that are queried. If the number of valid retrieval results is less than topK, the remaining invalid labels are padded with -1.

Restrictions

  • topK ∈ (0, 4096]
  • n ∈ (0, 10000]
  • queryData cannot be empty, and the data length must be greater than or equal to n × dim.
  • dists cannot be empty, and its pointed data length must be greater than or equal to n × topK.
  • labels cannot be empty, and its pointed data length must be greater than or equal to n × topK.