langchain.vectorstores.elastic_vector_search.ElasticKnnSearch¶
class langchain.vectorstores.elastic_vector_search.ElasticKnnSearch(index_name: str, embedding: Embeddings, es_connection: Optional['Elasticsearch'] = None, es_cloud_id: Optional[str] = None, es_user: Optional[str] = None, es_password: Optional[str] = None, vector_query_field: Optional[str] = 'vector', query_field: Optional[str] = 'text')[source]¶
[Deprecated]  [DEPRECATED] Elasticsearch with k-nearest neighbor search
(k-NN) vector store.
Recommended to use ElasticsearchStore instead, which supports
metadata filtering, customising the query retriever and much more!
You can read more on ElasticsearchStore:
https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
It creates an Elasticsearch index of text data that
can be searched using k-NN search. The text data is transformed into
vector embeddings using a provided embedding model, and these embeddings
are stored in the Elasticsearch index.
index_name¶
The name of the Elasticsearch index.
Type
str
embedding¶
The embedding model to use for transforming text data
into vector embeddings.
Type
Embeddings
es_connection¶
An existing Elasticsearch connection.
Type
Elasticsearch, optional
es_cloud_id¶
The Cloud ID of your Elasticsearch Service
deployment.
Type
str, optional
es_user¶
The username for your Elasticsearch Service deployment.
Type
str, optional
es_password¶
The password for your Elasticsearch Service
deployment.
Type
str, optional
vector_query_field¶
The name of the field in the Elasticsearch
index that contains the vector embeddings.
Type
str, optional
query_field¶
The name of the field in the Elasticsearch index
that contains the original text data.
Type
str, optional