Used to perform sparse vector search via text_expansion.
Used for when you want to use ELSER model to perform document search.
At build index time, this strategy will create a pipeline that
will embed the text using the ELSER model and store the
resulting tokens in the index.
At query time, the text will be embedded using the ELSER
model and the resulting tokens will be used to
perform a text_expansion query.
Parameters
model_id – Optional. Default is “.elser_model_1”.
ID of the model to use to embed the query text
within the stack. Requires embedding model to be
deployed to Elasticsearch.
__init__(index_name: str, *, embedding: ~typing.Optional[~langchain.schema.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.vectorstores.elasticsearch.BaseRetrievalStrategy = <langchain.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