Elasticsearch v5.0.0 ObjectMapper don’t have writeValueAsBytes()?

I'm using elasticsearch (v5.0.0) in java application. I can't find writeValueAsBytes() function.

But Java Api have similar example.

This is all functions in ObjectMapper class:

Hi @kevinZ,

you are using org.elasticsearch.index.mapper.ObjectMapper instead of com.fasterxml.jackson.databind.ObjectMapper. You need to add the following dependency to your project's build.gradle file:

compile "com.fasterxml.jackson.core:jackson-databind:2.8.1"

(See mvnrepository.com for the syntax of other build systems).

Unfortunately, the docs fail to mention that; we'll correct it. Thanks for spotting it.

Daniel

1 Like

Thanks! :slight_smile: @danielmitterdorfer

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