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.PITIDinstead ofstring/*string. Build one withParsePITIDand read it withString. The wire format doesn't change.- Required PIT response fields on
CreatePITResp,PITDeleted, andPITDetailare values, not pointers.client.PIT.Deleteandclient.PIT.DeleteAllreturn a*PartialPITDeleteErrorwhen the server keeps some of the PITs they name. Maskerrmask.PITDeleteItemsto 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.Openreturns a PIT handle that is safe for concurrent use.client.SearchAfter,client.PIT.SearchAfter, and theirPagesvariants page a sorted search withsearch_afterand stop on an incomplete page instead of skipping documents. Seeguides/usage-search.md(#1183)Compressoronopensearch.Configandopensearchtransport.Configpicks the request codec and level, withGZip(level)andNone()built in. It replacesCompressRequestBody, 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):
CompressRequestBodygzipped bodies that already had aContent-Encoding, and could corrupt a compressed body that outlived its request. By @iprithv in #1180 - fix(opensearchutil):
JSONReader.Readreturned 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.