Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring data elasticsearch and @JsonRootName #33

Open
takearun opened this issue Nov 24, 2017 · 0 comments
Open

Spring data elasticsearch and @JsonRootName #33

takearun opened this issue Nov 24, 2017 · 0 comments

Comments

@takearun
Copy link

takearun commented Nov 24, 2017

Hi,

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,

{
   "event":{
      "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,
spring.jackson.deserialization.UNWRAP_ROOT_VALUE=true

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

Can you please help.

Thanks,
Arun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant