java+elasticsearch批量导入数据

废话不多说 直接上代码

		BulkProcessor bulkProcessor = BulkProcessor.builder(
		        client,    
		        new BulkProcessor.Listener() {
		            public void beforeBulk(long executionId,
		                                   BulkRequest request) {} 

		            public void afterBulk(long executionId,
		                                  BulkRequest request,
		                                  BulkResponse response) { } 

		            public void afterBulk(long executionId,
		                                  BulkRequest request,
		                                  Throwable failure) {} 
		        }
				)
				.setBulkActions(100000)
		        .build();

关键是这个bulkProcessor怎么声明,官网是写得比较含糊

你可能感兴趣的:(bug)