github opensearch-project/opensearch-go v5.0.1

6 hours ago

opensearch-go v5.0.1

UPGRADE NOTE - v5.0.1 changes the PIT API in ways that can break a build.

  • PIT ID fields are typed as opensearchapi.PITID instead of string/*string. Build one with ParsePITID and read it with String. The wire format doesn't change.
  • Required PIT response fields on CreatePITResp, PITDeleted, and PITDetail are values, not pointers.
  • client.PIT.Delete and client.PIT.DeleteAll return a *PartialPITDeleteError when the server keeps some of the PITs they name. Mask errmask.PITDeleteItems to get the old behavior.

Before/after for each is in UPGRADING_V5.md.

v5.0.1 is the first patch on the v5 line. It adds a closable PIT handle with search_after iterators and a pluggable request Compressor, and fixes several request-body bugs.

Requires Go 1.26.8 or later.

Full Changelog: v5.0.0...v5.0.1


What's new

  • client.PIT.Open returns a PIT handle that is safe for concurrent use. client.SearchAfter, client.PIT.SearchAfter, and their Pages variants page a sorted search with search_after and stop on an incomplete page instead of skipping documents. See guides/usage-search.md (#1183)
  • Compressor on opensearch.Config and opensearchtransport.Config picks the request codec and level, with GZip(level) and None() built in. It replaces CompressRequestBody, which is deprecated. By @iprithv in #1180

Fixes

  • fix(opensearchtransport): a failed read of the request body sent an empty or partial body instead of an error. An empty search body runs as match_all. By @iprithv in #1181
  • fix(opensearchtransport): CompressRequestBody gzipped bodies that already had a Content-Encoding, and could corrupt a compressed body that outlived its request. By @iprithv in #1180
  • fix(opensearchutil): JSONReader.Read returned leftover data with no error after an encode failure. By @iprithv in #1181
  • fix(osapilint): several v4 -> v5 rewrite fixes, reported by @Jakob3xD in #1174. By @itsmeasadali and @ryanyuan in #1170, #1184, #1189

Dependencies

  • Bump the go directive to 1.26.8 for the standard library CVE fixes (#1172)
  • Bump the AWS SDK, smithy-go, and OpenTelemetry (#1172, #1191)

See CHANGELOG.md for the full list.

Contributors

Thanks to everyone who contributed to this release: @sean-, @ryanyuan, @iprithv, @itsmeasadali, and @magic-peach.

New Contributors

Don't miss a new opensearch-go release

NewReleases is sending notifications on new releases.