Run similarity search between a query vector and the indexed vectors.
similarity_search_by_vector(
self,
embedding: List[float],
k: int = 4,
filter: Optional[RedisFilterExpression] = None,
return_metadata: bool = True,
distance_threshold: Optional[float] = None,
**kwargs: Any = {}
) -> List[Document]| Name | Type | Description |
|---|---|---|
embedding* | List[float] | The query vector for which to find similar documents. |
k | int | Default: 4The number of documents to return. Default is 4. |
filter | RedisFilterExpression | Default: NoneOptional metadata filter. Defaults to None. |
return_metadata | bool | Default: TrueWhether to return metadata. Defaults to True. |
distance_threshold | Optional[float] | Default: NoneMaximum vector distance between selected documents and the query vector. Defaults to None. |