But the request failed with this error:
ErrorCause: {"type":"document_parsing_exception","reason":"[1:24] object mapping for [learning_item_title] tried to parse field [learning_item_title] as object, but found a concrete value"}.
but this solution failed because of this error:
java.lang.IllegalArgumentException: Class class co.elastic.clients.elasticsearch.core.bulk.CreateOperation cannot be read from JSON
at co.elastic.clients.util.WithJsonObjectBuilderBase.withJson(WithJsonObjectBuilderBase.java:46)
Look at the mappings for the index you are trying to index into using the get mapping API. It seems the field learning_item_title, possibly due to earlier documents or a static mapping, is mapped as an object. This means that trying to index a string for this field results in a mapping conflict.
That is as expected. It has fields specified underneath, e.g. de_DE and en_US, which means that it is an object and can not take strings. You will need to change the structure of the document you try to index.
By the way, does the bulkrequest support the script type under the Update operation? If so, is there any documents about how to setup script content in the bulkrequest (the source data still come from JSON like:'{'script:'xxxxx'}')?
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.