Search (AscendIndex)
API definition |
void Search(std::vector<AscendIndex *> indexes, idx_t n, const float *x, idx_t k,float *distances, idx_t *labels, bool merged); |
|---|---|
Function |
Queries the feature vectors for multiple AscendIndex libraries and returns the distance and IDs of the most similar k features based on the input feature vectors. The following algorithms are supported:
|
Input |
std::vector<AscendIndex *> indexes: multiple indexes to perform retrieval. idx_t n: number of queries for retrieval. const float *x: query vectors for retrieval. idx_t k: number of the most similar results to be returned. bool merged: whether to merge the retrieval results of multiple indexes. |
Output |
float *distances: distance between a vector and the first k nearest vectors. idx_t *labels: IDs of the first k nearest vectors that are queried. |
Return value |
N/A |
Restrictions |
|