that contains the original text data.
Type
str, optional
Usage:>>> from embeddings import Embeddings
>>> embedding = Embeddings.load('glove')
>>> es_search = ElasticKnnSearch('my_index', embedding)
>>> es_search.add_texts(['Hello world!', 'Another text'])
>>> results = es_search.knn_search('Hello')
[(Document(page_content='Hello world!', metadata={}), 0.9)][*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
Usage:>>> from embeddings import Embeddings