/** * Should a refresh be executed post this bulk operation causing the operations to * be searchable. Note, heavy indexing should not set this to <tt>true</tt>. Defaults * to <tt>false</tt>. */ public BulkRequestBuilder setRefresh(boolean refresh) { request.refresh(refresh); return this; }
@Override public Object execute(final Client client) { final BulkRequest deletes = new BulkRequest().refresh(true); for (final String id : eventIds) { for (final String index : indexNamingStrategy.getRetrievalNames(snifferId)) { deletes.add(new DeleteRequest(index, getType(snifferId), id)); } } client.bulk(deletes).actionGet(); logger.info("Deleted events: {}", (Object[]) eventIds); return null; } });
final ShardId shardId = entry.getKey(); final List<BulkItemRequest> requests = entry.getValue(); BulkShardRequest bulkShardRequest = new BulkShardRequest(bulkRequest, shardId, bulkRequest.refresh(), requests.toArray(new BulkItemRequest[requests.size()])); bulkShardRequest.consistencyLevel(bulkRequest.consistencyLevel()); bulkShardRequest.timeout(bulkRequest.timeout());