Return docs most similar to query.
similarity_search_with_score(
self,
query: str,
k: int = 4,
filter: Optional[Dict[str, str]] = None,
body_search: Optional[Union[str, List[str]]] = None
) -> List[Tuple[Document, float]]Returns: List of (Document, score), 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. |