search
API definition |
void search(idx_t n, const uint8_t *x, idx_t k, int32_t *distances, idx_t *labels, const SearchParameters *params) const override; |
|---|---|
Function |
Queries feature vectors. It returns the IDs and distances of the most similar k features based on the input feature vectors. |
Input |
idx_t n: number of query vectors. const uint8_t *x: query vectors. idx_t k: number of the most similar results to be returned. const SearchParameters *params (not supported now): optional parameter in Faiss. The default value is nullptr. |
Output |
int32_t*distances: distance between a vector and the first k nearest vectors. idx_t *labels: IDs of k nearest vectors. |
Return value |
N/A |
Restrictions |
|
API definition |
void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const; |
|---|---|
Function |
Queries feature vectors and returns the IDs and distances of the most similar k features based on the input feature vectors. It can be used to search for binary features and retrieval features of the float type. |
Input |
idx_t n: number of query vectors. const float *x: query vector. idx_t k: number of the most similar results to be returned. |
Output |
float *distances: distance between a query vector and the first k nearest vectors. idx_t *labels: IDs of k nearest vectors. |
Return value |
N/A |
Restrictions |
|