SearchBatchedParallel
API Definition
1. Status ScannInterface::SearchBatchedParallel(const DenseDataset<float>& queries, MutableSpan<NNResultsVector> res, int final_nn, int pre_reorder_nn, int leaves, int batch_size) const;
2. Status ScannInterface::SearchBatchedParallel(const DenseDataset<float>& queries, const std::vector<int64_t>& indices, MutableSpan<NNResultsVector> res, int final_nn, int pre_reorder_nn, int leaves, int batch_size) const;
Function
- Parallel batch query search (multi-thread behavior consistent with the open source algorithm).
- An overload of the parallel batch query search function, including a list of indices for component filtering (KScaNN-specific API).
Parameters
Parameter |
Data Type |
Description |
Value Range |
|---|---|---|---|
queries |
const DatapointPtr<float>& |
Queries in a batch. |
The value cannot be null. |
res |
MutableSpan<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. |
≥ 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. |
indices |
const std::vector<int64_t>& |
Indices of the elements used for filtering. |
The value cannot be null. |
batch_size |
int |
Size of the search batch. |
[1, MAXINT]. The default value is 256. |
Return Value
Data Type |
Description |
|---|---|
Status |
Execution status of the method. You can determine whether the method is successfully executed by calling status.ok(). |