within the stack. Requires embedding model to be
deployed to Elasticsearch.
__init__(index_name: str, *, embedding: ~typing.Optional[~langchain_core.embeddings.Embeddings] = None, es_connection: ~typing.Optional[Elasticsearch] = None, es_url: ~typing.Optional[str] = None, es_cloud_id: ~typing.Optional[str] = None, es_user: ~typing.Optional[str] = None, es_api_key: ~typing.Optional[str] = None, es_password: ~typing.Optional[str] = None, vector_query_field: str = 'vector', query_field: str = 'text', distance_strategy: ~typing.Optional[~typing.Literal[<DistanceStrategy.COSINE: 'COSINE'>, <DistanceStrategy.DOT_PRODUCT: 'DOT_PRODUCT'>, <DistanceStrategy.EUCLIDEAN_DISTANCE: 'EUCLIDEAN_DISTANCE'>]] = None, strategy: ~langchain_community.vectorstores.elasticsearch.BaseRetrievalStrategy = <langchain_community.vectorstores.elasticsearch.ApproxRetrievalStrategy object>)[source]¶
async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns
List of IDs of the added texts.
Return type
List[str]
async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents: List[Document], **kwargs: Any) → List[str]¶
Run more documents through the embeddings and add to the vectorstore.
Parameters
(List[Document] (documents) – Documents to add to the vectorstore.
Returns