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

Add elastic 8 support via github.com/elastic/go-elasticsearch/v8 #30755

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

harryzcy
Copy link
Contributor

@harryzcy harryzcy commented Apr 29, 2024

Closes #30752

github.com/elastic/go-elasticsearch/v8 only support Elasticsearch v8, so the previous code is kept for v7 compatibility.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 29, 2024
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 29, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/dependencies labels Apr 29, 2024
@silverwind
Copy link
Member

silverwind commented Apr 29, 2024

Also update the action:

image: elasticsearch:7.5.0

image: elasticsearch:7.5.0

@harryzcy
Copy link
Contributor Author

elasticsearch 7 is still supported until 9.x is released. I think we should support both

@silverwind
Copy link
Member

silverwind commented Apr 29, 2024

Ok, it's actually fine to test the minimum supported version. We do this for databases too.

@stevapple
Copy link
Contributor

IIRC github.com/elastic/go-elasticsearch/v8 doesn’t support (at least) older Elasticsearch v7 clusters, nor OpenSearch.

Additional work is required to maintain compatibility with these distros.

@pull-request-size pull-request-size bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 21, 2024
@harryzcy harryzcy marked this pull request as ready for review July 21, 2024 06:02
@harryzcy
Copy link
Contributor Author

I'm adding a ELASTICSEARCH_VERSION setting. Not sure if it's the best option, and not sure if we can auto detect the major version of ElasticSearch used

@silverwind
Copy link
Member

The REST API returns version at root as version.number:

https://opster.com/guides/elasticsearch/how-tos/check-elasticsearch-version/

@harryzcy harryzcy marked this pull request as draft July 24, 2024 04:21
@harryzcy
Copy link
Contributor Author

Fixing up last few issues, probably Elastic REST API authentication related.
Somehow the Elastic related test with Postgres db test is not running. I'm testing on my own fork right now

@silverwind
Copy link
Member

silverwind commented Jul 24, 2024

Regarding opensearch (and I'm fine leaving that out in this PR), I think the status quo is:

olivere/elastic/v7 should be compatible with elasticsearch 7 and opensearch 1
elastic/go-elasticsearch/v8 is only compatible with elasticsearch 8
opensearch-project/opensearch-go is compatible with opensearch 2 and maybe opensearch 1

So unfortunately, it seems to support them all I'm afraid we need 3 modules. It's a mess. API is supposed to be similar on all of them. Maybe it'd be also an option to consume the REST API plainly without those modules.

@harryzcy
Copy link
Contributor Author

Hmm, is TestESIndexAndSearch in modules/indexer/code not triggered? there should be a few errors with that test

Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

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

Looks reasonable and I would like to try upgrading my instance to elasticsearch 8, so I would give it a go.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/dependencies modifies/go Pull requests that update Go code modifies/internal size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch 8 support
4 participants