-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Changes
We use Elastic in production for more since 2012. Although Elastic is stable we don't have a stable API (and probably never will).
The reason for this is that Elasticsearch changes quite often and at a fast pace. At this moment we still focus on features, not on a stable API.
Having said that, there have been no huge changes that required us to rewrite our applications big time. More often than not it's renaming APIs and adding/removing features so that we are in sync with the Elasticsearch API.
This page is meant to be a guideline about changes in the API as we move along from version to version.
Notice that the master branch in Elastic is defunct! Development on the different versions happens on branches that follow the release-branch.v<X>
pattern, where <X>
is the current version of Elastic (release-branch.v7
at the time of writing this). If you want to use stable versions of Elastic, use the packages released via github.com/olivere/elastic (for v6 and v7) and gopkg.in (for v1-v5).
Here's the version matrix:
Elasticsearch version | Elastic version | Package URL |
---|---|---|
7.x | 7.0 |
github.com/olivere/elastic/v7 (source doc) |
6.x | 6.0 |
github.com/olivere/elastic (source doc) |
5.x | 5.0 |
gopkg.in/olivere/elastic.v5 (source doc) |
2.x | 3.0 |
gopkg.in/olivere/elastic.v3 (source doc) |
1.x | 2.0 |
gopkg.in/olivere/elastic.v2 (source doc) |
0.9-1.3 | 1.0 |
gopkg.in/olivere/elastic.v1 (source doc) |
Example:
You have Elasticsearch 1.7.6 installed and want to use Elastic. As listed above, you should use Elastic 2.0. So you first install Elastic 2.0.
$ go get gopkg.in/olivere/elastic.v2
Then you use it via the following import path:
import "gopkg.in/olivere/elastic.v2"
Elastic 7.0 targets Elasticsearch 7.0 and later. Elasticsearch 7.0.0 was released on 10th April 2019.
Here is the list of breaking changes in Elasticsearch 7.0. The most prominent change is the removal of types.
Notice that Elastic 7.0 supports Go modules and you need to use an import path of github.com/olivere/elastic/v7
. Elastic 7.0 also requires a Go version of 1.10.3 or later (all versions of Go that support Go modules).
Elastic 6.0 targets Elasticsearch 6.0 and later. Elasticsearch 6.0.0 was released on 14th November 2017.
Here is the list of breaking changes in Elasticsearch 6.0.
Elastic 5.0 targets Elasticsearch 5.0 and later. Elasticsearch 5.0.0 was released on 26th October 2016.
Notice that there are a lot of breaking changes in Elasticsearch 5.0.
Elastic 3.0 targets Elasticsearch 2.0 and later. Elasticsearch 2.0.0 was released on 28th October 2015.
Notice that there are a lot of breaking changes in Elasticsearch 2.0 and we used this as an opportunity to clean up and refactor Elastic as well.
Elastic 2.0 targets Elasticsearch 1.x and published via gopkg.in/olivere/elastic.v2
. It is deprecated and will only receive critical fixes.
Elastic 1.0 is deprecated. You should really update Elasticsearch and Elastic to a recent version.
However, if you cannot update for some reason, don't worry. Version 1.0 is still available. All you need to do is go-get it and change your import path as described above.