Consider the following piece of indexing code and please set know how i can add attributes to link parent and child documents. This piece of documentation is missing on Elasticseach site.
public void writeInBulkRoot(BulkProcessor bulkProcessor, String indexName, String type, String id, String payLoad) {
IndexRequest indexRequest = (id == null ? new IndexRequest(indexName, type)
: new IndexRequest(indexName, type, id));
indexRequest.source(payLoad, XContentType.JSON);
indexRequest.create(true);
//TODO: How to i set the join field and parent id
try {
bulkProcessor.add(indexRequest);
} catch (Exception e) {
logger.error("Exception while connecting to Elastic. Taking defaults:" + e.getMessage(), e);
}
}
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.