feat(client): add PIT, reindex/by-query, resolve-index actions and fix request-param serialization#30
Merged
Conversation
…x request-param serialization New actions (no new dependencies; classes ship in the OpenSearch server jar): - Point-in-Time: CreatePit, DeletePit, GetAllPits (_search/point_in_time) - Reindex, UpdateByQuery, DeleteByQuery (shared HttpBulkByScrollAction base) - ResolveIndex (_resolve/index) Correctness fixes to existing actions: - HttpIndexAction: forward if_seq_no/if_primary_term (optimistic-concurrency guard was silently dropped) and require_alias - HttpGetAction: forward _source include/exclude filtering - HttpBulkAction: bulk-update retry_on_conflict, and global pipeline/routing/require_alias - HttpMultiSearchAction: send typed_keys so named aggregations parse - HttpSearchAction, FieldCapabilities, PutMapping, Get/UpdateSettings, Explain: forward indices options and other dropped parameters - wait_for_active_shards: serialize ActiveShardCount.ALL as "all" (was "-1", which the server rejects); collapse the duplicate emission in HttpClusterHealthAction Adds unit tests for the new actions and the fixed parameter serialization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands OpenSearch
ClientAPI coverage and fixes several request-parameter serialization bugs in existing actions. All new actions use classes that already ship in the OpenSearchserverjar, so no new dependency is introduced.New actions
HttpCreatePitAction,HttpDeletePitAction,HttpGetAllPitsAction(_search/point_in_time)HttpReindexAction,HttpUpdateByQueryAction,HttpDeleteByQueryAction(sharedHttpBulkByScrollActionbase parsingBulkByScrollResponse)HttpResolveIndexAction(_resolve/index)Correctness fixes to existing actions
HttpIndexAction: forwardif_seq_no/if_primary_term— optimistic-concurrency was silently dropped on the index path (the delete/update paths already forwarded it), plusrequire_alias.HttpGetAction: forward_sourceinclude/exclude filtering.HttpBulkAction: per-itemretry_on_conflicton update items, and bulk-levelpipeline/routing/require_alias.HttpMultiSearchAction: sendtyped_keys=trueso named aggregations/suggesters in sub-searches parse (parity with single search).HttpSearchAction,HttpFieldCapabilitiesAction,HttpPutMappingAction,HttpGetSettingsAction,HttpUpdateSettingsAction,HttpExplainAction: forward indices options and other previously-dropped parameters (via new sharedHttpAction.appendIndicesOptions/expandWildcardshelpers).wait_for_active_shards:ActiveShardCount.ALLnow serializes to"all"instead of-1(which the server rejects with HTTP 400); this is applied across all actions that emit the parameter, and the duplicate emission inHttpClusterHealthActionis collapsed to a single correct value.Testing
fromXContentresponse parsing) and for the fixed request-parameter serialization (ActionTestUtilsbuilds an inspectableCurlRequestso params can be asserted without a live cluster).mvn testexcluding the Docker/Testcontainers*ClientTestintegration classes). The container-based integration tests should be run in CI to validate the new actions end-to-end against live engines.