Initialize DocArrayHnswSearch store.
from_params(
cls,
embedding: Embeddings,
work_dir: str,
n_dim: int,
dist_metric: Literal['cosine', 'ip', 'l2'] = 'cosine',
max_elements: int = 1024,
index: bool = True,
ef_construction: int = 200,
ef: int = 10,
M: int = 16,
allow_replace_deleted: bool = True,
num_threads: int = 1,
**kwargs: Any = {}
) -> DocArrayHnswSearch| Name | Type | Description |
|---|---|---|
embedding* | Embeddings | Embedding function. |
work_dir* | str | path to the location where all the data will be stored. |
n_dim* | int | dimension of an embedding. |
dist_metric | str | Default: 'cosine'Distance metric for DocArrayHnswSearch can be one of: "cosine", "ip", and "l2". Defaults to "cosine". |
max_elements | int | Default: 1024Maximum number of vectors that can be stored. Defaults to 1024. |
index | bool | Default: TrueWhether an index should be built for this field. Defaults to True. |
ef_construction | int | Default: 200defines a construction time/accuracy trade-off. Defaults to 200. |
ef | int | Default: 10parameter controlling query time/accuracy trade-off. Defaults to 10. |
M | int | Default: 16parameter that defines the maximum number of outgoing connections in the graph. Defaults to 16. |
allow_replace_deleted | bool | Default: TrueEnables replacing of deleted elements with new added ones. Defaults to True. |
num_threads | int | Default: 1Sets the number of cpu threads to use. Defaults to 1. |
**kwargs | Any | Default: {}Other keyword arguments to be passed to the get_doc_cls method. |