spring-data-elasticsearch - Jackson can't serialize using global configuration spring-data-elasticsearch - Jackson can't serialize using global configuration elasticsearch elasticsearch

spring-data-elasticsearch - Jackson can't serialize using global configuration


It seems that Spring Data elasticsearch doesn't utilize the default spring Jackson2ObjectMapperBuilder for this. Per default this configuration is used:

https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/DefaultEntityMapper.java

... which you can overwrite by providing some custom object mapper as described here:

https://github.com/spring-projects/spring-data-elasticsearch/wiki/Custom-ObjectMapper

Here you can of course directly use your Jackson ObjectMappers. For more details, have a look at this issue at the jhipster github repo:

https://github.com/jhipster/generator-jhipster/issues/2241#issuecomment-151933768