API Description
KScaNN does not provide external interfaces but makes intrusive modifications to the open source ScaNN algorithm, including interface additions to the core ScaNN class ScannInterface. 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. The methods provided by the KScaNN-modified version of ScannInterface are shown in Table 1.
API |
Function |
|---|---|
SetNumThreads |
Configures the number of threads for search operations (KScaNN-specific addition). |
SearchAdditionalParams |
Extends ScaNN functionality with custom search parameters (KScaNN-specific addition). |
Search |
Single-query search (single-thread behavior consistent with the open source algorithm). |
SearchBatched |
Batch query search (single-thread behavior consistent with the open source algorithm). |
SearchBatchedParallel |
Parallel batch query search (multi-thread behavior consistent with the open source algorithm). |
Initialize |
Index construction (consistent with the open source algorithm). |
SerializeToMemory |
Serializes the index into memory (KScaNN-specific addition). |
LoadFromMemory |
Restore the index instance from memory (KScaNN-specific addition). |
GetNum |
Obtains the number of vectors in the base library (KScaNN-specific addition). |
GetDim |
Obtains the dimensions of vectors in the base library (KScaNN-specific addition). |