Skip to content
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

Update Elasticsearch spring implementation for 0.34 #37

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

dadoonet
Copy link
Contributor

@dadoonet dadoonet commented Aug 29, 2024

This new implementation expects to have an Elasticsearch Rest Client bean (recommended) or it will create it otherwise.

This updates brings:

About tests:

  • We don't disable security anymore as it's not a good practice. We should educate users instead.
  • We don't wait anymore for 1s for documents to be available, but instead we call the refresh API to make the documents immediately visible. So we change the awaitUntilPersisted() method to awaitUntilPersisted(ApplicationContext) so we can fetch the Elasticsearch Rest Client bean.
  • We allow testing against a running cluster (local/cloud) and set from the CLI the URL (ELASTICSEARCH_URL), api key (ELASTICSEARCH_API_KEY), username (ELASTICSEARCH_USERNAME) and password (ELASTICSEARCH_PASSWORD). Note that when running with a self-signed certificate, the BASE64 version of the CA should be provided (ELASTICSEARCH_CA_CERTIFICATE).
  • We fetch the version of the cluster used to run the tests from the pom.xml file using elastic.version property.
  • We upgrade testcontainers to 1.20.1

This new implementation expects to have an Elasticsearch Rest Client bean (recommended) or it will create it otherwise.

This updates brings:

* The support for the new way to implement the Elasticsearch embbeding store as we now pass a rest client instead of "just" properties (deprecated in langchain4j/langchain4j#712)
* The removal of previously needed number of dimensions (deprecated in langchain4j/langchain4j#712)
* We add a `checkSslCertificates` property which should be only used in tests.

About tests:

* We don't disable security anymore as it's not a good practice. We should educate users instead.
* We don't wait anymore for 1s for documents to be available, but instead we call the refresh API to make the documents immediately visible. So we change the `awaitUntilPersisted()` method to `awaitUntilPersisted(ApplicationContext)` so we can fetch the Elasticsearch Rest Client bean.
* We allow testing against a running cluster (local/cloud) and set from the CLI the URL (`ELASTICSEARCH_URL`), api key (`ELASTICSEARCH_API_KEY`), username (`ELASTICSEARCH_USERNAME`) and password (`ELASTICSEARCH_PASSWORD`). Note that when running with a self-signed certificate, the BASE64 version of the CA should be provided (`ELASTICSEARCH_CA_CERTIFICATE`).
* We fetch the version of the cluster used to run the tests from the `pom.xml` file using `elastic.version` property.
* We upgrade testcontainers to 1.20.1
Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dadoonet thank you!

@langchain4j langchain4j merged commit e052f56 into langchain4j:main Sep 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants