Hello,
I am unable to ingest content in an object field with the java client 2.2.0.
Please note that i have the same problem for nested objects but for String/long/arrays etc, it all works
Field creation
mappingSource .startObject(ElasticLibrary.TYPE_CONTENT) .startObject("properties") .startObject("part") .field(TYPE, TYPE_STRING) .endObject() .startObject("name") .field(TYPE, TYPE_STRING) .endObject() .endObject() .endObject();
The mapping is created fine.
This is how i try to ingest :
contentBuilder = XContentFactory.jsonBuilder();
contentBuilder.startObject().prettyPrint();
contentBuilder.field(ElasticLibrary.TYPE_CONTENT, new Content(text));
contentBuilder.endObject().prettyPrint().humanReadable(true);
indexRequestBuilder.setSource(contentBuilder);
indexRequestBuilder.execute().actionGet();
My content object :
public class Content implements Serializable{
private String part;
private String name;
If i run this i will get the error
org.elasticsearch.index.mapper.MapperParsingException: object mapping for [CONTENT] tried to parse field [CONTENT] as object, but found a concrete value
Does anyone know why i am getting this error ?
Thank you.