Skip to content

feat(client): add PIT, reindex/by-query, resolve-index actions and fix request-param serialization#30

Merged
marevol merged 1 commit into
mainfrom
feature/action-coverage-and-correctness
Jul 7, 2026
Merged

feat(client): add PIT, reindex/by-query, resolve-index actions and fix request-param serialization#30
marevol merged 1 commit into
mainfrom
feature/action-coverage-and-correctness

Conversation

@marevol

@marevol marevol commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Expands OpenSearch Client API coverage and fixes several request-parameter serialization bugs in existing actions. All new actions use classes that already ship in the OpenSearch server jar, so no new dependency is introduced.

New actions

  • Point-in-Time: HttpCreatePitAction, HttpDeletePitAction, HttpGetAllPitsAction (_search/point_in_time)
  • Reindex / by-query: HttpReindexAction, HttpUpdateByQueryAction, HttpDeleteByQueryAction (shared HttpBulkByScrollAction base parsing BulkByScrollResponse)
  • Resolve index: HttpResolveIndexAction (_resolve/index)

Correctness fixes to existing actions

  • HttpIndexAction: forward if_seq_no / if_primary_term — optimistic-concurrency was silently dropped on the index path (the delete/update paths already forwarded it), plus require_alias.
  • HttpGetAction: forward _source include/exclude filtering.
  • HttpBulkAction: per-item retry_on_conflict on update items, and bulk-level pipeline / routing / require_alias.
  • HttpMultiSearchAction: send typed_keys=true so 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 shared HttpAction.appendIndicesOptions / expandWildcards helpers).
  • wait_for_active_shards: ActiveShardCount.ALL now 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 in HttpClusterHealthAction is collapsed to a single correct value.

Testing

  • Adds unit tests for the new actions (fromXContent response parsing) and for the fixed request-parameter serialization (ActionTestUtils builds an inspectable CurlRequest so params can be asserted without a live cluster).
  • Full unit suite: 285 tests pass (mvn test excluding the Docker/Testcontainers *ClientTest integration classes). The container-based integration tests should be run in CI to validate the new actions end-to-end against live engines.

…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.
@marevol marevol merged commit ad215ae into main Jul 7, 2026
1 check passed
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.

1 participant