Nested index settings that do not end up deserialized in otherSettings leads to requiring properties on parent JSON nodes
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
- Domain
- backend-api-design, search
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
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
otherSettingswith 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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastic/elasticsearch-java
-
Delete By Query deserialization will not account for search failuresPossibly taken @l-trotta claimed this 9 days ago. Open
elastic/elasticsearch-java#1349 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
RestClientTransport sends bulk bodies as one HTTP chunk / TLS record / syscall per NDJSON buffer, burning ~45x the reactor CPU of the HLRCPossibly taken @l-trotta claimed this 25 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
elastic/elasticsearch-java#1339 · 5 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
elastic/elasticsearch-java#1212 · 8 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
elastic/elasticsearch-java#1165 · 5 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
elastic/elasticsearch-java#1083 · 2 comments ·
Maintainers usually reply within 1 day
All issues in elastic/elasticsearch-java
Similar issues
-
Use GHA setup gradle actionPossibly taken @bric3 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openhab/openhab-addons#21921 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jellyfin/jellyfin-androidtv#5885 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
priority:P2 product:orazaka type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day