Search
API Definition
Status ScannInterface::Search(const DatapointPtr<float> query, NNResultsVector* res, int final_nn, int pre_reorder_nn, int leaves) const;
Function
Single-query search (single-thread behavior consistent with the open source algorithm).
Parameters
Parameter |
Data Type |
Description |
Value Range |
|---|---|---|---|
query |
const DatapointPtr<float> |
The query. |
The value cannot be null. |
res |
NNResultsVector* |
Stores final results (labels and distances) with length final_nn for each entry representing the number of returned results. |
The value cannot be null. The length is the number of query vectors. |
final_nn |
int |
Number of returned results (Top K). |
≥ 1. The value must match the build parameters. |
pre_reorder_nn |
int |
Number of results saved before reordering. |
≥ final_nn, where final_nn indicates the number of results returned. |
leaves |
int |
Number of subspaces to be searched. |
[1, n_leaves], where n_leaves indicates the total number of subspaces in the IVF index partition. |
Return Value
Data Type |
Description |
|---|---|
Status |
Execution status of the method. You can determine whether the method is successfully executed by calling status.ok(). |