From 2556ab361c96a3c50cf6d8cb94bc1ff66690a9d6 Mon Sep 17 00:00:00 2001 From: Joseph McElroy Date: Thu, 28 Sep 2023 09:25:05 +0100 Subject: [PATCH 1/2] un-deprecate the elastic vector store --- .../vectorstores/elastic_vector_search.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/langchain/langchain/vectorstores/elastic_vector_search.py b/libs/langchain/langchain/vectorstores/elastic_vector_search.py index 2ef39d1e966cd..0b1cf8a62fc1a 100644 --- a/libs/langchain/langchain/vectorstores/elastic_vector_search.py +++ b/libs/langchain/langchain/vectorstores/elastic_vector_search.py @@ -1,4 +1,3 @@ -"""[DEPRECATED] Please use ElasticsearchStore instead.""" from __future__ import annotations import uuid @@ -51,9 +50,19 @@ def _default_script_query(query_vector: List[float], filter: Optional[dict]) -> } -@deprecated("0.0.265", alternative="ElasticsearchStore class.", pending=True) class ElasticVectorSearch(VectorStore): - """[DEPRECATED] `Elasticsearch` vector store. + """ + + ElasticVectorSearch uses the brute force method of searching on vectors. + + Recommended to use ElasticsearchStore instead, which gives you the option + to uses the approx HNSW algorithm which performs better on large datasets. + + ElasticsearchStore also supports metadata filtering, customising the + query retriever and much more! + + You can read more on ElasticsearchStore: + https://python.langchain.com/docs/integrations/vectorstores/elasticsearch To connect to an `Elasticsearch` instance that does not require login credentials, pass the Elasticsearch URL and index name along with the From 5fec163c3a06b3eaf2ce5807fc69642d54e73031 Mon Sep 17 00:00:00 2001 From: Joseph McElroy Date: Thu, 28 Sep 2023 09:43:12 +0100 Subject: [PATCH 2/2] fix lint --- .../langchain/vectorstores/elastic_vector_search.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/langchain/langchain/vectorstores/elastic_vector_search.py b/libs/langchain/langchain/vectorstores/elastic_vector_search.py index 0b1cf8a62fc1a..be7695d89122b 100644 --- a/libs/langchain/langchain/vectorstores/elastic_vector_search.py +++ b/libs/langchain/langchain/vectorstores/elastic_vector_search.py @@ -348,10 +348,17 @@ def delete(self, ids: Optional[List[str]] = None, **kwargs: Any) -> None: self.client.delete(index=self.index_name, id=id) +@deprecated("0.0.265", alternative="ElasticsearchStore class.", pending=True) class ElasticKnnSearch(VectorStore): """[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