Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Nested index settings that do not end up deserialized in otherSettings leads to requiring properties on parent JSON nodes

Open
#1,347 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@l-trotta is already working on this.

Since Oct 2, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java

Research direction

Start by reproducing the create and getSettings calls from the issue against an existing Elasticsearch cluster, focusing on deserialization of nested index settings and otherSettings. Trace how the returned JSON is mapped when an unknown nested key appears without the required parent property. Done means getSettings succeeds for this case while preserving unknown settings as described.

Written by the indexing model from the issue text.

Description

Area: Specification Category: Bug
Java API client version

8.14.3

Java version

21

Elasticsearch Version

8.19.11

Problem description

I'm working with elasticsearch-java against existing Elasticsearch clusters and indices, and I noticed strange behavior with regards to index settings.

Consider this snippet:

 ElasticsearchClient client = ...
 client.indices()
            .create(create -> create.index("test-index")
                        .settings(settings -> settings.numberOfShards("1")
                                .numberOfReplicas("0")
                                .otherSettings("index.store.fs.fs_lock", JsonData.of("simple"))));
client.indices().getSettings(settings -> settings.index("test-index"));

The above fails on getSettings with this exception:

co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'Storage.type' (JSON path: ['test-index'].settings.index.store) (line no=1, column no=256, offset=255)

I think the problem is when we do not specify includeDefaults - the JSON structure comes back without the required type field under store - but when index.store.fs.fs_lock comes back in the nested structure, the tokenization sees store and expects a full Storage object, including type which is required.

One approach would be to encode every possible index setting into the specification, but this would require an Elasticsearch client upgrade. My understanding is that the Java client is meant to be forward compatible with all Elasticsearch clusters. (Of course, any fix would require an upgrade to pick up - but I'm speaking more generically in principle for all settings this could apply to in the future)

The example above is contrived - in practice what can come up is inheriting Elasticsearch clusters that had these index settings already provisioned (perhaps, for example, from usage of RestHighLevelClient in the past) and then using the elasticsearch-java client ends up breaking on this API call. I'm also quite sure this could come up with arbitrary index settings.

I would expect the desired behavior to be:

  • Prune the returned JSON of all settings that are not recognized in the specification, recursively eliminating any blocks that become empty
  • Put all the unknown settings into otherSettings with flat keys

But the above isn't elegant because of two JSON walkthrough passes, so open to other suggestions or thoughts.

Dominant language
Java
Stars
524
Forks
299
Avg merge
6h 12m
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/elasticsearch-java

All issues in elastic/elasticsearch-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.