This commit is contained in:
mcy
2019-07-09 19:08:35 +08:00
parent 4f7842c843
commit 60a46ae941

View File

@@ -210,16 +210,16 @@ public class ESTemplate {
}
}
}
resetBulkRequestBuilder();
}
}
/**
* 如果大于批量数则提交批次, 调用后es bulk请求后,numberOfActions不会清理,需要主动调用函数清0,否则不能起到批量请求的效果
* 如果大于批量数则提交批次
*/
private void commitBulk() {
if (getBulk().numberOfActions() >= MAX_BATCH_SIZE) {
commit();
resetBulkRequestBuilder();
}
}