Skip to content

[ESRTEST-30704] Add #update to Index#68

Open
sergio-bobillier wants to merge 2 commits into
masterfrom
sb-ESRTEST-30704-add-update-to-index
Open

[ESRTEST-30704] Add #update to Index#68
sergio-bobillier wants to merge 2 commits into
masterfrom
sb-ESRTEST-30704-add-update-to-index

Conversation

@sergio-bobillier

Copy link
Copy Markdown
Collaborator

Adds the #update method to the Index class. This method allows the caller to update a document by ID. The caller can either provide a partial document with the updates they want to make or an update script.

Additional changes:

The addition of the #update method made it evident that the QueryBuilder::Script class should actually be directly under the Elasticsearch namespace, since it can be used outside the context of query construction. A commit is included to handle that. To keep backwards compatibility an alias is being added in place of the old class with a deprecation notice.

The objective is to avoid causing a string of releases in downstream tools.

Moves the Script class out of the QueryBuilder namespace and leaves it
directly under Elasticsearch. This is done because there are scripted
elements in Elasticsearch outside the context of queries, such as
scripts that run when documents are updated or reindexed.

Therefore it makes sense to have the Script class in a more general
namespace.
The method allows the caller to update a document in the index by
providing the document ID and the updated fields or an update script.
@sergio-bobillier sergio-bobillier force-pushed the sb-ESRTEST-30704-add-update-to-index branch from 40023bb to 04fb56e Compare June 30, 2026 11:08
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