Spring data elasticsearch and @JsonRootName


I use spring-boot-starter-data-elasticsearch dependency in my Java spring project to query ES 2.4.0

My json's look like this,

      "eventName":"Man U vs Arsenal",
      "eventDateTime":"Mon 24 Oct 12:00"

To avoid having to declare an empty "event" POJO wrapper, I use @JsonRootName(value="event") to mark that there's a root element in my POJO and I have also specified this in my application.properties,

The search is happening fine but the root element declaration does not happen and results in objects with just nulls.

Can you please help.


I think the best place to ask this is on the spring data elasticsearch project on GitHub on their forum if any.

Ok, thanks.


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