Hi ,
I am using bulk api with upsert , some times it is not giving me unusual result .
when I am sending the document in 200's bulk.
BulkProcessor bulkProcessor = BulkProcessor.builder(client, new BulkProcessor.Listener() {
@Override
public void beforeBulk(long executionId, BulkRequest request) {
System.out.println("Going to execute new bulk composed of {} actions : "+request.numberOfActions());
}
@Override public void afterBulk(long executionId, BulkRequest request, BulkResponse response) { System.out.println("Executed bulk composed of {} actions : "+request.numberOfActions()); }
@Override public void afterBulk(long executionId, BulkRequest request, Throwable failure) { System.out.println("Error executing bulk : "+failure); } }).setBulkActions(200).setFlushInterval(TimeValue.timeValueMinutes(5)).setConcurrentRequests(10).build();
for (i=0;i<=400;i++)
{
IndexRequest indexRequest = new IndexRequest(indexName, indexType, "your-doc-ID")
.source(jsondoc);UpdateRequest updateRequest = new UpdateRequest(indexName, indexType, "your-doc-ID") .doc(jsonBuilder() .startObject() .field("LastUpdateTime" , "datetime" + i) .endObject()) .upsert(indexRequest); bulkProcessor.add(updateRequest); System.out.println("Done Updation");
}
so each time LastUpdateTime is getting updated and some time is is showing me datetime200 and sometimes datetime400.
But when I am increasing the size of my bulk to 1000 then It is working fine ..
but when bulk size is 200 , sometimes it is showing me datetime200 and sometimes datetime400.
Could you pls let me know , why it is showing this distinguish unusual behavior