Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ endif
ifdef race
$(eval testintegargs += "-race")
endif
$(eval testintegargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v8,github.com/elastic/go-elasticsearch/v8/esutil,github.com/elastic/go-elasticsearch/v8/typedapi" "-coverprofile=$(PWD)/tmp/integration-client.cov" "-tags='$(testintegtags)'" "-timeout=1h")
$(eval testintegargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v9,github.com/elastic/go-elasticsearch/v9/esutil,github.com/elastic/go-elasticsearch/v9/typedapi" "-coverprofile=$(PWD)/tmp/integration-client.cov" "-tags='$(testintegtags)'" "-timeout=1h")
@if which gotestsum > /dev/null 2>&1 ; then \
cd internal/testing/e2e; \
echo "gotestsum --format=short-verbose --junitfile=$(PWD)/tmp/integration-report.xml --" $(testintegargs); \
Expand All @@ -49,7 +49,7 @@ test-api: ## Run generated API integration tests
ifdef race
$(eval testapiargs += "-race")
endif
$(eval testapiargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v8/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h")
$(eval testapiargs += "-cover" "-coverpkg=github.com/elastic/go-elasticsearch/v9/esapi" "-coverprofile=$(PWD)/tmp/integration-api.cov" "-tags='integration'" "-timeout=1h")
ifdef flavor
else
$(eval flavor='free')
Expand Down Expand Up @@ -101,7 +101,6 @@ test-examples: ## Execute the _examples
@printf "\033[2m→ Testing the examples...\033[0m\n"
@{ \
set -e ; \
trap "test -d .git && git checkout --quiet _examples/**/go.mod" INT TERM EXIT; \
for d in _examples/*/; do \
printf "\033[2m────────────────────────────────────────────────────────────────────────────────\n"; \
printf "\033[1mUpdating dependencies for $$d\033[0m\n"; \
Expand Down Expand Up @@ -266,9 +265,9 @@ endif

godoc: ## Display documentation for the package
@printf "\033[2m→ Generating documentation...\033[0m\n"
@echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v8"
@echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v8/esapi"
@echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v8/esutil"
@echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v9"
@echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v9/esapi"
@echo "* http://localhost:6060/pkg/github.com/elastic/go-elasticsearch/v9/esutil"
@printf "\n"
godoc --http=localhost:6060 --play

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ or
**[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page)**
**for a free trial of Elastic Cloud**.

[![Go Reference](https://pkg.go.dev/github.com/elastic/go-elasticsearch?status.svg)](https://pkg.go.dev/github.com/elastic/go-elasticsearch/v8)
[![Go Reference](https://pkg.go.dev/github.com/elastic/go-elasticsearch?status.svg)](https://pkg.go.dev/github.com/elastic/go-elasticsearch/v9)
[![Go Report Card](https://goreportcard.com/badge/github.com/elastic/go-elasticsearch)](https://goreportcard.com/report/github.com/elastic/go-elasticsearch)
[![codecov.io](https://codecov.io/github/elastic/go-elasticsearch/coverage.svg?branch=main)](https://codecov.io/gh/elastic/go-elasticsearch?branch=main)
[![Build](https://github.com/elastic/go-elasticsearch/workflows/Build/badge.svg)](https://github.com/elastic/go-elasticsearch/actions?query=branch%3Amain)
Expand All @@ -28,23 +28,23 @@ Elasticsearch language clients are only backwards compatible with default distri

When using Go modules, include the version in the import path, and specify either an explicit version or a branch:

require github.com/elastic/go-elasticsearch/v8 v8.0.0
require github.com/elastic/go-elasticsearch/v7 7.17
require github.com/elastic/go-elasticsearch/v9 v9.x.x
require github.com/elastic/go-elasticsearch/v8 v8.x.x

It's possible to use multiple versions of the client in a single project:

// go.mod
github.com/elastic/go-elasticsearch/v7 v7.17.0
github.com/elastic/go-elasticsearch/v8 v8.0.0
github.com/elastic/go-elasticsearch/v8 v8.18.0
github.com/elastic/go-elasticsearch/v9 v9.0.0

// main.go
import (
elasticsearch7 "github.com/elastic/go-elasticsearch/v7"
elasticsearch8 "github.com/elastic/go-elasticsearch/v8"
elasticsearch7 "github.com/elastic/go-elasticsearch/v8"
elasticsearch8 "github.com/elastic/go-elasticsearch/v9"
)
// ...
es7, _ := elasticsearch7.NewDefaultClient()
es8, _ := elasticsearch8.NewDefaultClient()
es8, _ := elasticsearch7.NewDefaultClient()
es9, _ := elasticsearch8.NewDefaultClient()

The `main` branch of the client is compatible with the current `master` branch of Elasticsearch.

Expand Down
6 changes: 3 additions & 3 deletions _benchmarks/benchmarks/actions/001_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"io"
"io/ioutil"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"

"github.com/elastic/go-elasticsearch/v8/benchmarks"
"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions _benchmarks/benchmarks/actions/002_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"io"
"io/ioutil"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"

"github.com/elastic/go-elasticsearch/v8/benchmarks"
"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions _benchmarks/benchmarks/actions/003_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"io/ioutil"
"strings"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/tidwall/gjson"

"github.com/elastic/go-elasticsearch/v8/benchmarks"
"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions _benchmarks/benchmarks/actions/004_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"io/ioutil"
"math/rand"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/tidwall/gjson"

"github.com/elastic/go-elasticsearch/v8/benchmarks"
"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions _benchmarks/benchmarks/actions/005_bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (

"github.com/tidwall/gjson"

"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v9/esapi"

"github.com/elastic/go-elasticsearch/v8/benchmarks"
"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"
)

func init() {
Expand Down
12 changes: 6 additions & 6 deletions _benchmarks/benchmarks/actions/006_bulk_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import (

"github.com/elastic/elastic-transport-go/v8/elastictransport"

"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v8/esapi"
"github.com/elastic/go-elasticsearch/v8/esutil"
"github.com/elastic/go-elasticsearch/v9"
"github.com/elastic/go-elasticsearch/v9/esapi"
"github.com/elastic/go-elasticsearch/v9/esutil"

"github.com/elastic/go-elasticsearch/v8/benchmarks"
"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"
)

func init() {
Expand Down Expand Up @@ -123,7 +123,7 @@ func init() {

biStats := bi.Stats()
if biStats.NumFailed > 0 {
return nil, fmt.Errorf("Unexpected failures: %s", biStats)
return nil, fmt.Errorf("Unexpected failures: %v", biStats)
}
if int(biStats.NumAdded) != c.NumOperations {
return nil, fmt.Errorf("Unexpected failures: added=%d, expected=%d", biStats.NumAdded, c.NumOperations)
Expand Down
4 changes: 1 addition & 3 deletions _benchmarks/benchmarks/benchmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package benchmarks
import (
"bytes"

"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"
)

var (
Expand All @@ -32,7 +32,6 @@ var (
)

// Action represents a benchmarked action.
//
type Action struct {
Name string
Category string
Expand All @@ -45,7 +44,6 @@ type Action struct {
}

// Register appends op to the list of operations.
//
func Register(a Action) error {
Actions = append(Actions, a)
return nil
Expand Down
8 changes: 4 additions & 4 deletions _benchmarks/benchmarks/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import (
"github.com/montanaflynn/stats"

"github.com/elastic/elastic-transport-go/v8/elastictransport"
"github.com/elastic/go-elasticsearch/v8"
"github.com/elastic/go-elasticsearch/v9"

"github.com/elastic/go-elasticsearch/v8/benchmarks"
"github.com/elastic/go-elasticsearch/v8/benchmarks/runner"
"github.com/elastic/go-elasticsearch/v9/benchmarks"
"github.com/elastic/go-elasticsearch/v9/benchmarks/runner"

_ "github.com/elastic/go-elasticsearch/v8/benchmarks/actions"
_ "github.com/elastic/go-elasticsearch/v9/benchmarks/actions"
)

var (
Expand Down
24 changes: 18 additions & 6 deletions _benchmarks/benchmarks/go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
module github.com/elastic/go-elasticsearch/v8/benchmarks
module github.com/elastic/go-elasticsearch/v9/benchmarks

go 1.22
go 1.23

toolchain go1.22.0
toolchain go1.24.2

replace github.com/elastic/go-elasticsearch/v8 => ../../
replace github.com/elastic/go-elasticsearch/v9 => ../../

require (
github.com/elastic/elastic-transport-go/v8 v8.6.1
github.com/elastic/go-elasticsearch/v8 v8.0.0-20200408073057-6f36a473b19f
github.com/elastic/go-elasticsearch/v9 v9.0.0-00010101000000-000000000000
github.com/fatih/color v1.7.0
github.com/montanaflynn/stats v0.6.3
github.com/tidwall/gjson v1.9.3
)

require github.com/mattn/go-colorable v0.1.6 // indirect
require (
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
golang.org/x/sys v0.19.0 // indirect
)
Loading
Loading