logger.debug("go to delete indexed issues for project {} not updated after {}", projectKey, boundDate);
SearchRequestBuilder srb = esIntegrationComponent.prepareESScrollSearchRequestBuilder(indexName);
jiraIssueIndexStructureBuilder.buildSearchForIndexedDocumentsNotUpdatedAfter(srb, projectKey, boundDate);
SearchResponse scrollResp = esIntegrationComponent.executeESSearchRequest(srb);
if (scrollResp.getHits().getTotalHits() > 0) {
if (isClosed())
throw new InterruptedException("Interrupted because River is closed");
scrollResp = esIntegrationComponent.executeESScrollSearchNextRequest(scrollResp);
BulkRequestBuilder esBulk = esIntegrationComponent.prepareESBulkRequestBuilder();
while (scrollResp.getHits().getHits().length > 0) {
for (SearchHit hit : scrollResp.getHits()) {
logger.debug("Go to delete indexed issue for document id {}", hit.getId());
if (jiraIssueIndexStructureBuilder.deleteIssueDocument(esBulk, hit)) {
indexingInfo.issuesDeleted++;
} else {
indexingInfo.commentsDeleted++;