Returns
List of Documents selected by maximal marginal relevance.
search(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
similarity_search(query: str, k: int = 4, text_in_page_content: Optional[str] = None, meta_filter: Optional[dict] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to query.
Parameters
query – Text query.
k – The maximum number of documents to return.
text_in_page_content – Filter by the text in page_content of Document.
meta_filter (Optional[dict]) – Filter by metadata. Defaults to None.
`{"color" (E.g.) – ”red”, “price”: 4.20}`. Optional.
`{"max_price" (E.g.) – 15.66, “min_price”: 4.20}`
field (price is the metadata) – 
filter (means range) – 
`{"maxe_price" (E.g.) – 15.66, “mine_price”: 4.20}`
field – 
filter – 
kwargs – Any possible extend parameters in the future.
Returns
Returns the k most similar documents to the specified text query.
similarity_search_by_vector(embedding: Optional[List[float]] = None, k: int = 4, text_in_page_content: Optional[str] = None, meta_filter: Optional[dict] = None, not_include_fields_in_metadata: Optional[Set[str]] = None, **kwargs: Any) → List[Document][source]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.