I am using ElasticSearch 5.6.10 and TransportClient for JAVA. I want to migrate it to ES 6.3.
To add any child documents, I am using the below code:
bulkProcessor.add((new IndexRequest(indexName, typeName)).source(data,XContentType.JSON).
parent(dmcId));
But this is possible when we have multiple mappings. And in ES 6.3, we are having single mapping type.
So can you help me with modifying in above code so as to add documents in ES 6.3.
I'll add join in my mapping file. As you can see below the way how a child document gets added.
PUT my_index/_doc/3?routing=1&refresh
{
"text": "This is an answer",
"my_join_field":
{
"name": "answer",
"parent": "1"
}
}
But how the documents will be added through Java(changes in the above Java code). Because while adding child documents, we have to add name, which is the child type and the parent.
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.