diff --git a/docs/reference/connecting.md b/docs/reference/connecting.md index 4efd7d1d09..aaf6a7df12 100644 --- a/docs/reference/connecting.md +++ b/docs/reference/connecting.md @@ -236,7 +236,7 @@ This section illustrates the best practices for leveraging the {{es}} client in package httpexample import ( - "github.com/elastic/go-elasticsearch/v8" + "github.com/elastic/go-elasticsearch/v9" ) var client *elasticsearch.Client @@ -264,7 +264,7 @@ package httpexample import ( "github.com/aws/aws-lambda-go/lambda" - "github.com/elastic/go-elasticsearch/v8" + "github.com/elastic/go-elasticsearch/v9" ) var client *elasticsearch.Client diff --git a/docs/reference/esql.md b/docs/reference/esql.md index d7f3b23e25..20529d1efc 100644 --- a/docs/reference/esql.md +++ b/docs/reference/esql.md @@ -59,8 +59,8 @@ import ( "fmt" "log" - "github.com/elastic/go-elasticsearch/v8" - "github.com/elastic/go-elasticsearch/v8/typedapi/esql/query" + "github.com/elastic/go-elasticsearch/v9" + "github.com/elastic/go-elasticsearch/v9/typedapi/esql/query" ) type Book struct { diff --git a/docs/reference/getting-started.md b/docs/reference/getting-started.md index eaa003fce2..65ea3141e0 100644 --- a/docs/reference/getting-started.md +++ b/docs/reference/getting-started.md @@ -18,7 +18,7 @@ Go version 1.21+ To install the latest version of the client, run the following command: ```shell -go get github.com/elastic/go-elasticsearch/v8@latest +go get github.com/elastic/go-elasticsearch/v9@latest ``` Refer to the [*Installation*](/reference/installation.md) page to learn more. diff --git a/docs/reference/index.md b/docs/reference/index.md index d8b36e6d59..14ed30c983 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -21,13 +21,16 @@ Full documentation is hosted at [GitHub](https://github.com/elastic/go-elasticse ## Usage [_usage] +:::::::{tab-set} + +::::::{tab-item} Low-level API ```go package main import ( "log" - "github.com/elastic/go-elasticsearch/v7" + "github.com/elastic/go-elasticsearch/v9" ) func main() { @@ -35,6 +38,29 @@ func main() { log.Println(es.Info()) } ``` +:::::: + +::::::{tab-item} Fully-typed API +```go +package main + +import ( + "context" + "log" + + "github.com/elastic/go-elasticsearch/v9" +) + +func main() { + es, _ := elasticsearch.NewTypedClient(elasticsearch.Config{ + Addresses: []string{"http://localhost:9200"}, + }) + log.Println(es.Info().Do(context.Background())) +} +``` +:::::: + +::::::: ::::{note} Please have a look at the collection of comprehensive examples in the repository at [https://github.com/elastic/go-elasticsearch/tree/master/_examples](https://github.com/elastic/go-elasticsearch/tree/master/_examples). diff --git a/docs/reference/installation.md b/docs/reference/installation.md index 74ed7f5a5e..c1edc5799e 100644 --- a/docs/reference/installation.md +++ b/docs/reference/installation.md @@ -8,13 +8,13 @@ mapped_pages: To install the 8.x version of the client, add the package to your `go.mod` file: ```text -require github.com/elastic/go-elasticsearch/v8 8.5 +require github.com/elastic/go-elasticsearch/v9 9.0 ``` Or, clone the repository: ```text -git clone --branch 8.5 https://github.com/elastic/go-elasticsearch.git $GOPATH/src/github +git clone --branch 9.0 https://github.com/elastic/go-elasticsearch.git $GOPATH/src/github ``` To install another version, modify the path or the branch name accordingly. The client major versions correspond to the {{es}} major versions. @@ -27,7 +27,7 @@ mkdir my-elasticsearch-app && cd my-elasticsearch-app cat > go.mod <<-END module my-elasticsearch-app - require github.com/elastic/go-elasticsearch/v8 main + require github.com/elastic/go-elasticsearch/v9 main END cat > main.go <<-END @@ -36,7 +36,7 @@ cat > main.go <<-END import ( "log" - "github.com/elastic/go-elasticsearch/v8" + "github.com/elastic/go-elasticsearch/v9" ) func main() { @@ -55,8 +55,8 @@ go run main.go The language clients are forward compatible; meaning that the clients support communicating with greater or equal minor versions of {{es}} without breaking. It does not mean that the clients automatically support new features of newer {{es}} versions; it is only possible after a release of a new client version. For example, a 8.12 client version won’t automatically support the new features of the 8.13 version of {{es}}, the 8.13 client version is required for that. {{es}} language clients are only backwards compatible with default distributions and without guarantees made. | Elasticsearch Version | Elasticsearch-Go Branch | Supported | -| --- | --- | --- | -| main | main | | -| 8.x | 8.x | 8.x | -| 7.x | 7.x | 7.17 | +|-----------------------|-------------------------|-----------| +| main | main | | +| 9.x | 9.x | 9.x | +| 8.x | 8.x | 8.x |