Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance asynchronously.
bulk_similarity_search(queries: Iterable[Union[str, Dict[str, float]]], k: int = 4, **kwargs: Any) → List[List[Document]][source]¶
Search the marqo index for the most similar documents in bulk with multiple
queries.
Parameters
queries (Iterable[Union[str, Dict[str, float]]]) – An iterable of queries to
bulk (execute in) – 
of (queries in the list can be strings or dictionaries) – 
queries. (weighted) – 
k (int, optional) – The number of documents to return for each query.
4. (Defaults to) – 
Returns
A list of results for each query.
Return type
List[List[Document]]