API Description
KScaNN does not provide external interfaces but makes intrusive modifications to the open source ScaNN algorithm, including interface additions. To achieve the optimal performance, KScaNN interfaces do not verify all input parameters. The validity of input parameters is ensured by the service that calls the interfaces, which are described in Table 1.
API |
Function |
|---|---|
set_num_threads |
Configures the number of threads for search operations (KScaNN-specific API). |
search_additional_params |
Extends ScaNN functionality with custom search parameters (KScaNN-specific API). |
search |
Single-query search (single-thread behavior consistent with the open source algorithm). |
search_batched |
Batch query search (single-thread behavior consistent with the open source algorithm). |
search_batched_parallel |
Parallel batch query search (multi-thread behavior consistent with the open source algorithm). |
builder |
Construction initialization (consistent with the open source algorithm). |
tree |
IVF partitioning configuration (consistent with the open source algorithm). |
score_ah |
Product quantization configuration (consistent with the open source algorithm). |
reorder |
Result reordering configuration (consistent with the open source algorithm). |
build |
Index construction (consistent with the open source algorithm). |
serialize_to_mem |
Stores the built index into an array (KScaNN-specific API). |
deserialize_from_mem |
Deserializes the array into the searcher instance (KScaNN-specific API). |
get_num |
Obtains the number of vectors in the base library (KScaNN-specific API). |
get_dim |
Obtains the dimensions of vectors in the base library (KScaNN-specific API). |
create_searcher |
Builds an index based on the input parameters and returns the ScannSearcher (filter_thr and filter_type are KScaNN-specific parameters). |