mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
- Description: fix ElasticVectorSearch.from_documents with elasticsearch_url param, - Issue: ElasticVectorSearch.from_documents failed #8293 # it fixes (if applicable), --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
parent
ad38eb2d50
commit
6384c1ec8f
@ -294,6 +294,8 @@ class ElasticVectorSearch(VectorStore, ABC):
|
|||||||
elasticsearch_url = get_from_dict_or_env(
|
elasticsearch_url = get_from_dict_or_env(
|
||||||
kwargs, "elasticsearch_url", "ELASTICSEARCH_URL"
|
kwargs, "elasticsearch_url", "ELASTICSEARCH_URL"
|
||||||
)
|
)
|
||||||
|
if "elasticsearch_url" in kwargs:
|
||||||
|
del kwargs["elasticsearch_url"]
|
||||||
index_name = index_name or uuid.uuid4().hex
|
index_name = index_name or uuid.uuid4().hex
|
||||||
vectorsearch = cls(elasticsearch_url, index_name, embedding, **kwargs)
|
vectorsearch = cls(elasticsearch_url, index_name, embedding, **kwargs)
|
||||||
vectorsearch.add_texts(
|
vectorsearch.add_texts(
|
||||||
|
Loading…
Reference in New Issue
Block a user