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:
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
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.