search_with_filter
API definition |
void search_with_filter(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels, const void *filters) const override; |
|---|---|
Function |
Queries the AscendIndexIVFSP feature vectors and returns IDs of the most similar k features based on the input feature vectors. It also provides the CID-based filtering function. filters is a uint32_t array with the length of n × 6. Every six uint32_t values form a filter. The first four digits (128 bits) of each filter indicate the corresponding CID, and the last two digits indicate the left-closed range of the corresponding timestamp, that is, [x, y). |
Input |
idx_t n: number of feature vectors to be queried. const float *x: feature vector data. idx_t k: number of the most similar results to be returned. const void *filters: filter criteria. |
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 |
|