|
@ -177,8 +177,9 @@ public class ElastricSearchHelper {
|
|
|
/**
|
|
|
* 删除
|
|
|
*/
|
|
|
public void delete(String index, String type, List<Object> datas) {
|
|
|
public boolean delete(String index, String type, List<Object> datas) {
|
|
|
JestClient jestClient = null;
|
|
|
BulkResult br = null;
|
|
|
try {
|
|
|
jestClient = elasticFactory.getJestClient();
|
|
|
|
|
@ -188,7 +189,7 @@ public class ElastricSearchHelper {
|
|
|
Delete indexObj = new Delete.Builder(((ESIDEntity) obj).getId()).build();
|
|
|
bulk.addAction(indexObj);
|
|
|
}
|
|
|
BulkResult br = jestClient.execute(bulk.build());
|
|
|
br = jestClient.execute(bulk.build());
|
|
|
|
|
|
|
|
|
logger.info("delete data count:" + datas.size());
|
|
@ -200,6 +201,7 @@ public class ElastricSearchHelper {
|
|
|
jestClient.shutdownClient();
|
|
|
}
|
|
|
}
|
|
|
return br.isSucceeded();
|
|
|
}
|
|
|
|
|
|
|