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

Is elastic.v5 supports also ES2? #431

Closed
AlmogBaku opened this issue Jan 5, 2017 · 6 comments
Closed

Is elastic.v5 supports also ES2? #431

AlmogBaku opened this issue Jan 5, 2017 · 6 comments

Comments

@AlmogBaku
Copy link

I'm working on the ES sink for Heapster(kubernetes metrics engine), and we are not sure if we need to treat ES5 as a separated sink, or if the same library supports basically both ES5 and ES2.

Can we use the elastic.v5 driver also for ES2?

@rikatz
Copy link

rikatz commented Jan 5, 2017

@AlmogBaku On my tests it worked fine.

Did some tests with ES2 as a cluster and also standalone, using the .v5 lib and it worked fine.

@rikatz
Copy link

rikatz commented Jan 5, 2017

I think that breaking changes were on fields containing the '.' character, but from 5 to 2 (and not the opposite).

@olivere
Copy link
Owner

olivere commented Jan 5, 2017

You should really use elastic.v5 for Elasticsearch 5.x, elastic.v3 for Elasticsearch 2.x and elastic.v2 for Elasticsearch 1.x.

The fact that it does work most of the time is just because ES is compatible between 2.x and 5.x for the features that you seem to use. It might break any time!

Just as an example, ES changed the way to sniff the nodes in a cluster between 1.x, 2.x and 5.x, so I was forced to change that. So you might get an exception when trying to connect to ES 2.x with v5, because the structs returned from ES 5.x changed.

What I do when I write migration scripts that move data between ES 2.x and 5.x is to use two Elastic clients side-by-side, one from elastic.v3 and one from elastic.v5.

I'm really trying hard to not break major versions. E.g. you should just be able to update elastic.v3 from 3.0.42 to 3.0.53 without any changes to your code. I don't guarantee that for an update from v3 to v5.

It'll get interesting when Go 1.8 comes out and we will move from "golang.org/x/net/context" to "context" :-)

@olivere olivere closed this as completed Jan 5, 2017
@rikatz
Copy link

rikatz commented Jan 5, 2017

Too bad for that :( hope you're able to make the versions compatible.

@AlmogBaku So, I'll 'fork' the ES2 sink to an ES5, using different libraries and see what happens (including the functions used by the new library).

Thanks @olivere

@AlmogBaku
Copy link
Author

AlmogBaku commented Jan 26, 2017 via email

@olivere
Copy link
Owner

olivere commented Jan 26, 2017

I'm sorry but that's out of scope for me. While it might be possible it'll take a lot of care and effort, and I already have a hard time keeping up with the pace of changes between different ES versions and features. I need major versions to be able to break stuff and keep things conceptually in sync. ES 2.x and 5.x are not 100% compatible.

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

No branches or pull requests

3 participants