Delete documents from the index.
Parameters
ids – List of ids of documents to delete
classmethod from_documents(documents: List[Document], embedding: Optional[Embeddings] = None, **kwargs: Any) → BESVectorStore[source]¶
Construct BESVectorStore wrapper from documents.
Parameters
documents – List of documents to add to the Elasticsearch index.
embedding – Embedding function to use to embed the texts.
Do not provide if using a strategy
that doesn’t require inference.
kwargs – create index key words arguments
classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[Dict[str, Any]]] = None, **kwargs: Any) → BESVectorStore[source]¶
Construct BESVectorStore wrapper from raw documents.
Parameters
texts – List of texts to add to the Elasticsearch index.
embedding – Embedding function to use to embed the texts.
metadatas – Optional list of metadatas associated with the texts.
index_name – Name of the Elasticsearch index to create.
kwargs – create index key words arguments
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.