create_searcher
API Definition
def create_searcher(db: numpy.ndarray, scann_config: str, training_threads: int, docids: numpy.ndarray, kmopt_pq_iter: int, kmopt_pq_sample: int, kmopt_pq_init: int, kmopt_ivf_iter: int, kmopt_ivf_sample: int, kmopt_ivf_init: int, filter_thr: float, filter_type: int) -> scann.scann_ops.ScannSearcher
Function
Builds an index based on the input parameters and returns the ScannSearcher (filter_thr and filter_type are KScaNN-specific parameters).
Parameters
Parameter |
Data Type |
Description |
Value Range |
|---|---|---|---|
db |
numpy.ndarray |
Base library vector. |
The value cannot be null. |
scann_config |
Character string |
Configuration file required for creating the index, containing all configuration parameters. |
- |
training_threads |
int |
Number of threads used for index construction. |
[0, MAXINT]. The default value is 0. |
docids |
numpy.ndarray |
Document ID. |
The default value is None. |
kmopt_pq_iter |
int |
Number of K-means iterations in PQ. |
[0, MAXINT]. The default value is 0. |
kmopt_pq_sample |
int |
Sample size for PQ K-means clustering. |
[0, MAXINT]. The default value is 0. |
kmopt_pq_init |
int |
K-means initialization type in PQ. |
{0, 1, 2, 3}. The default value is 0.
|
kmopt_ivf_iter |
int |
Number of K-means iterations in IVF. |
[0, MAXINT]. The default value is 0. |
kmopt_ivf_sample |
int |
Sample size for IVF K-means clustering. |
[0, MAXINT]. The default value is 0. |
kmopt_ivf_init |
int |
IVF K-means initialization type. |
{0, 1, 2, 3}. The default value is 0.
|
filter_thr |
float |
Filter threshold. |
[0, 1]. The default value is 0. |
filter_type |
int |
Filter type. |
The value is 0 or 1. The default value is 0.
|
Return Value
Data Type |
Description |
|---|---|
scann.scann_ops.ScannSearcher |
The build starts and the built ScannSearcher is returned. |