Skip to content

[JAY-737] Allow clients to change an index's write block#55

Merged
sergio-bobillier merged 4 commits into
masterfrom
sb-JAY-737-index-settings
Feb 20, 2026
Merged

[JAY-737] Allow clients to change an index's write block#55
sergio-bobillier merged 4 commits into
masterfrom
sb-JAY-737-index-settings

Conversation

@sergio-bobillier

@sergio-bobillier sergio-bobillier commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator

This set of commits introduce the necessary changes to allow clients to modify an index's write block.

This is needed before maintenance tasks can be performed on the index, for example, triggering a forced segment merging or re-indexing data.

The client can retrieve the settings for an index by calling the #settings method on the index, for example:

index = JayAPI::Elasticsearch::Index.new(client:, index_name:)
settings = index.settings

It is possible for the client to confirm the status of the write block on the index by calling the #write_blocked? method, like so:

settings.blocks.write_blocked?

It is likewise possible to change the write block to make the index's data read-only:

settings.blocks.write = true # Activates the write block, making the index's data read-only
...
settings.blocks.write = false # Disables the write block, allowing data to be indexed again

@sergio-bobillier sergio-bobillier self-assigned this Feb 13, 2026
@sergio-bobillier sergio-bobillier marked this pull request as ready for review February 13, 2026 10:31
Comment thread lib/jay_api/elasticsearch/indices/settings/blocks.rb Outdated
@sergio-bobillier sergio-bobillier force-pushed the sb-JAY-737-index-settings branch from 0314e09 to 2d2a9fa Compare February 17, 2026 09:41
@sergio-bobillier sergio-bobillier changed the title [JAY-737] Allow clients to change an index's read-only setting [JAY-737] Allow clients to change an index's write block Feb 17, 2026
@sergio-bobillier sergio-bobillier force-pushed the sb-JAY-737-index-settings branch from 2d2a9fa to 33e243c Compare February 17, 2026 09:53
The class represents the settings for an Elasticsearch Index. It will be
used in an upcoming commit to add a #settings method to the
Elasticsearch::Index class, which will allow the client to retrieve the
index's settings.
The class represents the blocks settings of an Elasticsearch index.

For the moment the class only deals with the write block.

This class will be used in an upcoming commit to complement the
Indices::Settings class to allow the user to access and change an
index's blocks settings.
The method gives the caller access to the index's blocks settings.
The method returns an instance of the Elasticsearch::Indices::Settings
class, which gives the caller access to the index's settings.
@sergio-bobillier sergio-bobillier force-pushed the sb-JAY-737-index-settings branch from 33e243c to 2879886 Compare February 19, 2026 09:21
@sergio-bobillier sergio-bobillier merged commit ca13314 into master Feb 20, 2026
2 checks passed
@sergio-bobillier sergio-bobillier deleted the sb-JAY-737-index-settings branch February 20, 2026 10:14
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.

2 participants