New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElasticVectorSearch constructor to support Elastic Cloud #1865
Comments
The login and password are working as expected, and you can set them up in the elasticsearch_url = "https://elastic:YOUR_PASSWORD@es_host:es_port"
elastic_search = ElasticVectorSearch(
elasticsearch_url= elasticsearch_url,
index_name= index_name,
embedding=embedding
) This approach also applies to ElasticSearch installations on the cloud or any other platform: elasticsearch_url = "https://elastic:YOUR_PASSWORD@es_host:es_port"
es = Elasticsearch(elasticsearch_url)
es.delete_by_query(index=es_index_name, body={"query": {"match_all": {}}}) |
This merge includes updated comments in the ElasticVectorSearch class to provide information on how to connect to `Elasticsearch` instances that require login credentials, including Elastic Cloud, without any functional changes. The `ElasticVectorSearch` class now inherits from the `ABC` abstract base class, which does not break or change any functionality. This allows for easy subclassing and creation of custom implementations in the future or for any users, especially for me 😄 I confirm that before pushing these changes, I ran: ```bash make format && make lint ``` To ensure that the new documentation is rendered correctly I ran ```bash make docs_build ``` To ensure that the new documentation has no broken links, I ran a check ```bash make docs_linkcheck ``` ![Capture](https://user-images.githubusercontent.com/64213648/228541688-38f17c7b-b012-4678-86b9-4dd607469062.JPG) Also take a look at #1865 P.S. Sorry for spamming you with force-pushes. In the future, I will be smarter.
I still have an issue. |
Hi, @brandco! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, the issue you reported was about the current constructor for ElasticVectorSearch not supporting connecting to Elastic Cloud, which limits usage to only instances of Elastic Search on localhost without security enabled. One user suggested a workaround by setting up login and password in the Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your contribution to the LangChain repository! |
Thank you all. I'm sorry I was not able to test this fix because I had to spin down my cloud instance. |
Thank you, @brandco, for closing the issue! We appreciate your help in keeping LangChain organized and efficient. |
The current constructor for ElasticVectorSearch does not support connecting to Elastic Cloud.
It looks like the current implementation would only support an instance of Elastic Search on localhost without security enabled, which is not recommended.
I can connect with the elasticsearch python client like this:
See the documentation at Connecting to Elastic Cloud
An alternative constructor to the ElasticVectorSearch that takes a elasticsearch client instance, index name and embedding object would allow the user to deal with all the possible authentication set ups before using langchain.
The text was updated successfully, but these errors were encountered: