How to force null values with SpringBoot?


I have a working API saving some null values in Elasticsearch. I need to keep that behaviour for existong consumers.

In order to do that with Spring Boot, I am using storeNullValue attribute on spring-data-elasticsearch Field annotation

    @JsonProperty(value = "descr")
    @Field(name = "descr", storeNullValue = true)
    private String description;

I recently upgraded from
Spring Boot 2.6 using spring-data-elsaticsearch 4.3.3
Spring Boot 3.1 using spring-data-elsaticsearch 5.1

And none of the null values are displayed anymore.

I tried upon elastic 7.16.2 and 8.8, and get the same result.

Perhaps there is a way force this using elastic mapping ?
I am not familiar with it.
Note that I need a null value, not an empty string or a string containing 'null'

Thanks for your caring

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.