Skip to content

Update module github.com/elastic/go-elasticsearch/v5 to v9#76

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/github.com-elastic-go-elasticsearch-v5-9.x
Open

Update module github.com/elastic/go-elasticsearch/v5 to v9#76
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/github.com-elastic-go-elasticsearch-v5-9.x

Conversation

@renovate

@renovate renovate Bot commented May 6, 2026

Copy link
Copy Markdown

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
github.com/elastic/go-elasticsearch/v5 v5.6.1v9.4.2 age confidence

Release Notes

elastic/go-elasticsearch (github.com/elastic/go-elasticsearch/v5)

v9.4.2

Compare Source

Bug Fixes
  • esutil: Omit empty routing query param in BulkIndexer (#​1515) (3845bb1)

v9.4.1

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1480) (86e8f65)

v9.4.0

Compare Source

⚠ BREAKING CHANGES
  • esutil: default Client to elasticsearch.NewBase in NewBulkIndexer
  • esapi: params previously typed *int on ~25 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes

v9.3.5

Compare Source

Bug Fixes
  • esutil: Omit empty routing query param in BulkIndexer (#​1514) (f9640f0)

v9.3.4

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1479) (7d5b37e)

v9.3.3

Compare Source

⚠ BREAKING CHANGES
  • esapi: params previously typed *int on ~20 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes

v9.3.2

Compare Source

⚠ BREAKING CHANGES
  • Typed API: update client from spec df81426
Features
Bug Fixes
  • esapi: Document Response.Body must be closed; fix leaks in examples (#​1313) (3b3dd1e)
  • esutil: Deterministic context check in BulkIndexer.Close (#​1340) (a02272b)
  • esutil: Propagate caller context through BulkIndexer item callbacks (#​1316) (d28cd9d)
  • Typed API: Context variable shadowing in TypedAPI Perform causing otel attributes to leak to parent span (#​1331) (f37f7d1)

v9.3.1

Compare Source

Bug Fixes
  • bulk_indexer: Enable instrumentation support in bulk index requests (#​1243) (3300e5d)
  • esutil: Avoid duplicate bulk indexer OnError callbacks (#​1251) (9255720)
  • esutil: Propagate context timeout while closing bulk indexer (#​1254) (6a0b973)
  • Prevent BulkIndexer from silently dropping items on flush failure (#​1241) (0215eec)
  • Typed API: Add field-level nil checks during deserialisation (#​1225) (fc22640)
  • Typed API: Add missing custom UnmarshalJSON methods for types with additional properties (fc22640)

v9.3.0

Compare Source

⚠ BREAKING CHANGES
  • Upgrade Go version from 1.23 to 1.24 (#​1137)
  • API: API methods and request fields that previously accepted a single string for resource identifiers (e.g., indices, names, IDs, routing, features) now require []string. Corresponding WithX helpers now accept variadic arguments (...string).
  • API: All ExpandWildcards request fields were changed from string to []string, and WithExpandWildcards helpers now accept variadic arguments (...string).
  • API: Routing parameters across document, search, and multi-document APIs were changed from string to []string, and related WithRouting helpers now accept variadic arguments (...string).
  • API: Duration-based parameters previously expressed as string now use time.Duration (e.g., KeepAlive, Interval, BucketSpan). Call sites must pass time.Duration values.
  • API: ML APIs using interface{} for start/end time parameters now require string values, removing support for arbitrary types.
  • API: Several top-level API methods now require []string instead of string for path parameters that support multiple resources (e.g., indices, templates, data streams, transforms, repositories, privileges).
  • API: MonitoringBulk was refactored: DocumentType support was removed, Interval is now time.Duration, and required parameters were added explicitly to the method signature.
  • API: Some WithX functional options changed between single-value and variadic forms to match API behaviour. Existing option usage may require updates.
  • API: Request struct fields were updated to reflect REST API semantics, including changes from string to []string and removal of deprecated fields. Direct struct initialization may require changes.
Features
  • API: Introduce strong typing for duration values (3c657da)
  • API: Support multi-value resource parameters (3c657da)
  • API: Support multiple resources per request (3c657da)
  • API: Update APIs to 9.3.0 (3c657da)
  • Expose FlushedMs metric in BulkIndexer (#​1191) (d67d0be)
  • Typed API: Add DenseVectorF32 and DenseVectorBytes types, improving indexing performance of dense vectors by up to 3x when used instead of a float32 array (f543b82)
  • Typed API: Update TypedAPI to latest elasticsearch-specification 9.3.0 (f543b82)
  • Upgrade Go version from 1.23 to 1.24 (#​1137) (05f15eb)
Bug Fixes
  • API: Align request structs with Elasticsearch REST spec (3c657da)
  • API: Align routing parameters with REST API (3c657da)
  • API: Correct functional option cardinality (3c657da)
  • API: Modernize MonitoringBulk API (3c657da)
  • API: Normalize expand_wildcards handling (3c657da)
  • API: Simplify ML time range parameters (3c657da)
  • esutil: Handle error from Seek in BulkIndexer.writeBody (#​1162) (ab7b3bb)
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1147) (e3e61d6)

v9.2.6

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1478) (e328483)

v9.2.5

Compare Source

⚠ BREAKING CHANGES
  • esapi: params previously typed *int on ~20 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes
  • esapi: Regenerate esapi with *int64 for long-typed params (#​1421) (e30cdb6)
  • gen: Map spec long to *int64 for esapi params (#​1392) (ef6e458)
  • gen: Normalize date URL part and param types to string (#​1415) (a029ed0)
  • gen: Pass []string to DeleteIndexTemplate in test boilerplate (#​1423) (af25eed)
  • gen: Pass []string to DeletePrivileges in xpack test boilerplate (#​1424) (d603097)
  • gen: Support *int64 fields in gen-tests output (#​1418) (3a61210)

v9.2.4

Compare Source

⚠ BREAKING CHANGES
  • Typed API: update client from spec 49022a2
Features
Bug Fixes
  • esapi: Document Response.Body must be closed; fix leaks in examples (#​1312) (c680847)
  • esutil: Deterministic context check in BulkIndexer.Close (#​1339) (0b34e21)
  • esutil: Propagate caller context through BulkIndexer item callbacks (#​1315) (cf70e22)
  • Typed API: Context variable shadowing in TypedAPI Perform causing otel attributes to leak to parent span (#​1330) (f52219c)

v9.2.3

Compare Source

Bug Fixes
  • bulk_indexer: Enable instrumentation support in bulk index requests (#​1242) (71b0b0d)
  • esutil: Avoid duplicate bulk indexer OnError callbacks (#​1250) (8537e89)
  • esutil: Propagate context timeout while closing bulk indexer (#​1253) (405af64)
  • Prevent BulkIndexer from silently dropping items on flush failure (#​1240) (755a9d3)
  • Typed API: Add field-level nil checks during deserialisation (#​1224) (59f268f)
  • Typed API: Add missing custom UnmarshalJSON methods for types with additional properties (59f268f)

v9.2.2

Compare Source

Features
Bug Fixes
  • esutil: Handle error from Seek in BulkIndexer.writeBody (#​1161) (5394405)
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1201) (b5ceeee)

v9.2.1

Compare Source

Features
Bug Fixes

v9.2.0: 9.2.0

Compare Source

API

  • Updated APIs to 9.2.0

Typed API

v9.1.2

Compare Source

Features
Bug Fixes
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1200) (f32bfca)

v9.1.1

Compare Source

Features
Bug Fixes

v9.1.0: 9.1.0

Compare Source

API

  • Updated APIs to 9.1.0

Typed API

  • Update TypedAPI to latest elasticsearch-specification 9.1
  • This release introduces a new MethodAPI used by the TypedClient which makes the client friendlier for dead code elimination.
    Reducing the size of the client when only a subset of the APIs are used. The old API structure remains available for backward compatibility, but it is now deprecated.

v9.0.1: 9.0.1

Compare Source

API

  • Updated APIs to 9.0.4

Typed API

v9.0.0: 9.0.0

Compare Source

  • The client now requires Go 1.23 or later.

New

  • This release introduces an optional package for the TypedAPI named esdsl.
    It provides a domain-specific language (DSL) for building Elasticsearch queries in Go.
    The DSL is designed to simplify query construction, making it easier to build complex queries without writing raw JSON.
// create index
{
    // delete index if exists
    if existsRes, err := es.Indices.Exists("test").IsSuccess(context.Background()); err != nil {
        log.Println(err)
        return
    } else if existsRes {
        if ok, _ := es.Indices.Delete("test").IsSuccess(context.Background()); !ok {
            log.Fatalf("Error deleting index: %v\n", err)
        }
        log.Println("Index deleted:", "test")
    } else {
        log.Println("Index does not exist:", "test")
    }

    mappings := esdsl.NewTypeMapping().
        AddProperty("name", esdsl.NewTextProperty()).
        AddProperty("age", esdsl.NewIntegerNumberProperty())

    createRes, err := es.Indices.Create("test").Mappings(mappings).Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }

    log.Printf("Index created: %#v\n", createRes)
}

// index document
{
    documents := []Document{
        {"Alice", 30},
        {"Bob", 25},
        {"Charlie", 35},
    }

    bulk := es.Bulk().Index("test")
    for _, document := range documents {
        err := bulk.IndexOp(types.IndexOperation{}, document)
        if err != nil {
            log.Println("Error indexing document:", err)
        }
    }
    bulkRes, err := bulk.Refresh(refresh.Waitfor).Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }
    if bulkRes.Errors {
        log.Println("Some documents failed to index")
        for _, item := range bulkRes.Items {
            for operationType, responseItem := range item {
                if responseItem.Error != nil {
                    log.Println("Operation:", operationType)
                    log.Println("Response:", responseItem)
                }
            }
        }
    }
    indexedDocs := 0
    for _, item := range bulkRes.Items {
        for _, responseItem := range item {
            if responseItem.Error == nil {
                indexedDocs++
            }
        }
    }

    log.Println("Documents indexed:", indexedDocs)
}

// calculate median age
{
    searchRes, err := es.Search().
        Index("test").
        Size(0).
        AddAggregation("median_age", esdsl.NewPercentilesAggregation().Field("age").Percents(50)).
        Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }

    if agg, ok := searchRes.Aggregations["median_age"].(*types.TDigestPercentilesAggregate); ok {
        if val, ok := agg.Values.(map[string]interface{})["50.0"]; ok {
            log.Println("Median age:", val)
        }
    }
}

// search documents
{
    matchRes, err := es.Search().
        Index("test").
        Query(esdsl.NewBoolQuery().
            Must(esdsl.NewMatchQuery("name", "Alice")).
            Filter(esdsl.NewNumberRangeQuery("age").Gte(20).Lte(40))).
        Sort(esdsl.NewSortOptions().AddSortOption("age", esdsl.NewFieldSort(sortorder.Asc))).
        Size(10).
        Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }
    if matchRes.Hits.Total.Value > 0 {
        for _, hit := range matchRes.Hits.Hits {
            doc := Document{}
            err := json.Unmarshal(hit.Source_, &doc)
            if err != nil {
                log.Println("Error unmarshalling document:", err)
                continue
            }
            log.Printf("Document ID: %s, Name: %s, Age: %d\n", *hit.Id_, doc.Name, doc.Age)
        }
    } else {
        log.Println("No documents found")
    }
}

API

  • Updated APIs to 9.0.0

Typed API

v8.19.6

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1477) (078f8ec)

v8.19.5

Compare Source

⚠ BREAKING CHANGES
  • esapi: params previously typed *int on ~20 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes

v8.19.4

Compare Source

⚠ BREAKING CHANGES
  • Typed API: update client from spec 6ee016a
Features
  • Add AutoDrainBody option for automatic response body draining (#​1370) (c9a2b0b)
  • Add functional options pattern for client instantiation (#​1321) (7561adf)
  • esutil: Add Flush method to BulkIndexer for explicit flush-and-wait (#​1361) (be8564d)
  • Typed API: Improved generated code comments (fe06c54)
  • Typed API: Update client from spec 6ee016a (74ed65d)
Bug Fixes
  • esutil: Deterministic context check in BulkIndexer.Close (#​1338) (a00439e)
  • esutil: Propagate caller context through BulkIndexer item callbacks (#​1314) (ca77d44)
  • Typed API: Context variable shadowing in TypedAPI Perform causing otel attributes to leak to parent span (#​1329) (fe06c54)

v8.19.3

Compare Source

Bug Fixes
  • bulk_indexer: Enable instrumentation support in bulk index requests (#​1244) (55c605e)
  • esutil: Avoid duplicate bulk indexer OnError callbacks (#​1249) (3f5bf89)
  • esutil: Propagate context timeout while closing bulk indexer (#​1252) (9fe5ea8)
  • Prevent BulkIndexer from silently dropping items on flush failure (#​1239) (b80ae39)
  • Typed API: Add field-level nil checks during deserialisation (#​1223) (7f27889)
  • Typed API: Add missing custom UnmarshalJSON methods for types with additional properties (7f27889)

v8.19.2

Compare Source

Features
Bug Fixes
  • esutil: Handle error from Seek in BulkIndexer.writeBody (#​1160) (cf53b87)
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1196) (08855c2)

v8.19.1

Compare Source

Features
Bug Fixes

v8.19.0: 8.19.0

Compare Source

API

  • Updated APIs to 8.19.0

Typed API

v8.18.1: 8.18.1

Compare Source

  • This patch release fixes the broken build found in 8.18.0. If you are using the TypedClient, you should update to this version.

v8.18.0: 8.18.0

Compare Source

  • Update elastictransport to 8.7.0.
  • Thanks to @​zaneli, the TypedClient can now be used in the BulkIndexer.

New

  • This release adds a BaseClient constructor with no attached APIs, allowing it to be used purely as a transport layer instead of a full-featured API client.
baseClient, err := elasticsearch.NewBaseClient(elasticsearch.Config{
    Addresses: []string{
        "http://localhost:9200",
    },
})

if err != nil {
    log.Println(err)
    return
}

res, err := esapi.InfoRequest{
    Pretty:     false,
    Human:      false,
    ErrorTrace: false,
    FilterPath: nil,
    Header:     nil,
    Instrument: baseClient.InstrumentationEnabled(),
}.Do(context.Background(), baseClient)

if err != nil {
    log.Println(err)
    return
}
defer res.Body.Close()
if res.IsError() {
    log.Println("Error response:", res)
    return
}
var infoMap map[string]interface{}
if err := json.NewDecoder(res.Body).Decode(&infoMap); err != nil {
    log.Println("Error parsing response:", err)
    return
}
log.Printf("Elasticsearch version esapi: %s\n", infoMap["version"].(map[string]interface{})["number"])

typedRes, err := info.New(baseClient).Do(context.Background())
if err != nil {
    log.Println(err)
    return
}
log.Printf("Elasticsearch version typedapi: %s\n", typedRes.Version.Int)

API

  • Updated APIs to 8.18.0

Typed API

v8.17.1

Compare Source

  • Update elastictransport to 8.6.1 fixes #​912

Thanks to @​AkisAya and @​jmfrees for their contributions!

v8.17.0

Compare Source

API

Updated APIs to 8.17.0

Typed API

Update APIs to latest elasticsearch-specification 8.17

v8.16.0

Compare Source

API

Typed API

Update APIs to latest elasticsearch-specification 8.16

v8.15.0: 8.15.0

Compare Source

API

  • API is generated from the Elasticsearch 8.15.0 specification.

Typed API

Update APIs to latest elasticsearch-specification 8.15

v8.14.0: 8.14.0

Compare Source

API

New APIs:

Typed API

New APIs:

Transport

v8.13.1: 8.13.1

Compare Source

Typed API

Update APIs to latest elasticsearch-specification 8.13

Fixes

This patch release brings a fix to the initialisation of the Request in endpoints which would prevent using the shortcuts for fields.
Canonical.Request() method was unaffected.

  • Autoscaling.PutAutoscalingPolicy
  • Indices.Downsample
  • Indices.PutSettings
  • Indices.SimulateTemplate
  • Inference.PutModel
  • Logstash.PutPipeline
  • Ml.ValidateDetector
  • SearchApplication.Put

v8.13.0: 8.13.0

Compare Source

API

New APIS:

  • ConnectorSecretGet

  • ConnectorSecretPost

  • ConnectorSecretPut

  • ConnectorSecretDelete

  • ConnectorUpdateIndexName

  • ConnectorUpdateNative

  • ConnectorUpdateStatus

  • ConnectorUpdateAPIKeyDocumentID

  • ConnectorUpdateServiceDocumentType

  • EsqlAsyncQuery Documentation

  • EsqlAsyncQueryGet Documentation

  • ProfilingFlamegraph Documentation

  • ProfilingStacktraces Documentation

  • TextStructureTestGrokPattern Documentation

  • Indices.ResolveCluster Documentation

  • Security.QueryUser Documentation

Typed API

Thanks to @​pakio, transport now has an optional pool based compression option. elastic/elastic-transport-go#19
And to @​tblyler for fixing a very subtle memory leak in the BulkIndexer. #​797

v8.12.1: 8.12.1

Compare Source

  • Fix: ticker memory leak in bulk indexer due to internal flush call resetting the ticker. #​797
  • Fix: Scroll now uses the body to pass the scroll_id. #​785
  • Add: generated UnmarshalJSON for Requests to allow injecting payloads using aliases.

Many thanks to @​tblyler, @​frkntplglu and @​HaraldNordgren for their contribution!

v8.12.0: 8.12.0

Compare Source

Client

Golang version

The client now requires Golang version 1.20

OpenTelemetry

The client now provides OpenTelemetry integration. This integration can be enabled in the config using the elasticsearch.NewOpenTelemetryInstrumentation.
Once set up, the provided context will be used to record spans with useful information about the request being made to the server.

More about what you can expect in the Semantic Conventions for Elasticsearch.

BulkIndexer

if_seq_no & if_primary_term are now supported thanks to @​benjyiw #​783

API

  • SimulateIngest
  • ConnectorCheckIn
  • ConnectorDelete
  • ConnectorGet
  • ConnectorLastSync
  • ConnectorList
  • ConnectorPost
  • ConnectorPut
  • ConnectorSyncJobCancel
  • ConnectorSyncJobCheckIn
  • ConnectorSyncJobDelete
  • ConnectorSyncJobError
  • ConnectorSyncJobGet
  • ConnectorSyncJobList
  • ConnectorSyncJobPost
  • ConnectorSyncJobUpdateStats
  • ConnectorUpdateConfiguration
  • ConnectorUpdateError
  • ConnectorUpdateFiltering
  • ConnectorUpdateName
  • ConnectorUpdatePipeline
  • ConnectorUpdateScheduling

Typed API

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate

renovate Bot commented May 6, 2026

Copy link
Copy Markdown
Author

ℹ️ Artifact update notice

File name: go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 1 additional dependency was updated
  • The go directive was updated for compatibility reasons

Details:

Package Change
go 1.13 -> 1.25
github.com/stretchr/testify v1.6.1 -> v1.10.0

@renovate renovate Bot force-pushed the renovate/github.com-elastic-go-elasticsearch-v5-9.x branch from 01b4b8e to 0a6492f Compare May 11, 2026 11:42
@renovate renovate Bot force-pushed the renovate/github.com-elastic-go-elasticsearch-v5-9.x branch from 0a6492f to 752fbc6 Compare June 22, 2026 16:12
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

Successfully merging this pull request may close these issues.

0 participants