Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,347 1 comentario 0 reacciones 1 asignado Ver en GitHub

@l-trotta ya está trabajando en esto.

Desde el 2/10/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Java
Estrellas
525
Forks
299
Merge medio
16 h 25 min
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de elastic/elasticsearch-java

Todos los issues de elastic/elasticsearch-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.