Return docs most similar to query.
similarity_search(
self,
query: str,
k: int = DEFAULT_TOPN,
text_in_page_content: Optional[str] = None,
meta_filter: Optional[dict] = None,
**kwargs: Any = {}
) -> List[Document]| Name | Type | Description |
|---|---|---|
query* | str | Text query. |
k | int | Default: DEFAULT_TOPNThe maximum number of documents to return. |
text_in_page_content | Optional[str] | Default: NoneFilter by the text in page_content of Document. |
meta_filter | Optional[dict] | Default: NoneFilter by metadata. Defaults to None. |
E.g. `{"color" * | unknown | "red", "price": 4.20}`. Optional. |
E.g. `{"max_price" * | unknown | 15.66, "min_price": 4.20}` |
E.g. `{"maxe_price" * | unknown | 15.66, "mine_price": 4.20}` |
kwargs | Any | Default: {}Any possible extend parameters in the future. |