Return docs most similar to embedding vector.
similarity_search_by_vector(
self,
embedding: List[float],
k: int = 4,
filter: Optional[Dict[str, str]] = None,
body_search: Optional[Union[str, List[str]]] = None,
**kwargs: Any = {}
) -> List[Document]Returns: List of Document, the most similar to the query vector.
| Name | Type | Description |
|---|---|---|
embedding* | List[float] | Embedding to look up documents similar to. |
k | int | Default: 4Number of Documents to return. Defaults to 4. |
filter | Optional[Dict[str, str]] | Default: NoneFilter on the metadata to apply. |
body_search | Optional[Union[str, List[str]]] | Default: NoneDocument textual search terms to apply. Only supported by Astra DB at the moment. |