Return docs most similar to query.
similarity_search(
self,
query: str,
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 |
|---|---|---|
query* | str | Text 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. |