Search (AscendIndexInt8)
API definition |
void Search(std::vector<AscendIndexInt8 *> indexes, idx_t n, const int8_t *x, idx_t k, float *distances, idx_t *labels, bool merged); |
|---|---|
Function |
Queries the feature vectors for multiple AscendIndexInt8 libraries and returns the distance and IDs of the most similar k features based on the input feature vectors. Currently, only the subtype AscendIndexInt8Flat derived from AscendIndexInt8 is supported. |
Input |
std::vector<AscendIndexInt8 *> indexes: multiple indexes to perform retrieval. idx_t n: number of queries for retrieval. const int8_t *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 |
|