We are using Elasticsearch database version 7.10.2 and also Elasticsearch java client - 7.17.20 in pom.xml
Implemented BulkRequest using the new Elasticsearch java client as below:
BulkRequest.Builder bulkRequestBuilder = new BulkRequest.Builder();
audit.es7.org.elasticsearch.action.bulk.BulkRequest re = new audit.es7.org.elasticsearch.action.bulk.BulkRequest();
for (int i = 0; i < bulkSize; i++) {
Product product = new Product();
Product = setBaseFields(Product, id);
IndexOperation<?> updatedIndexOperation = new IndexOperation.Builder<>()
.index(index)
.id(userCreatedAuditEvent.getEventId().toString())
.document(product)
.build();
// Add the updated IndexOperation to the bulk request
bulkRequestBuilder.operations(op -> op.index(updatedIndexOperation));
}
// Execute the bulk request
BulkResponse response = client.bulk(bulkRequestBuilder.build());
Error:
co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/bulk] failed: [action_request_validation_exception] Validation Failed: 1: type is missing;2: type is missing;3: type is missing;4: type is missing;5: type is missing;6: type is missing;7: type is missing;8: type is missing;9: type is missing;10: type is missing;
Could you please suggest some solution on fixing this issue. Thanks!
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.