use of org.sonar.server.es.BulkIndexer in project sonarqube by SonarSource.
the class ComponentIndexer method delete.
public void delete(String projectUuid, Collection<String> disabledComponentUuids) {
BulkIndexer bulk = new BulkIndexer(esClient, INDEX_TYPE_COMPONENT.getIndex());
bulk.start();
disabledComponentUuids.stream().forEach(uuid -> bulk.addDeletion(INDEX_TYPE_COMPONENT, uuid, projectUuid));
bulk.stop();
}
use of org.sonar.server.es.BulkIndexer in project sonarqube by SonarSource.
the class IssueIndexer method deleteProject.
@Override
public void deleteProject(String uuid) {
BulkIndexer bulk = new BulkIndexer(esClient, INDEX_TYPE_ISSUE.getIndex());
bulk.start();
SearchRequestBuilder search = esClient.prepareSearch(INDEX_TYPE_ISSUE).setRouting(uuid).setQuery(boolQuery().must(termQuery(FIELD_ISSUE_PROJECT_UUID, uuid)));
bulk.addDeletion(search);
bulk.stop();
}
use of org.sonar.server.es.BulkIndexer in project sonarqube by SonarSource.
the class RuleIndexer method createBulkIndexer.
private BulkIndexer createBulkIndexer(Size size) {
BulkIndexer bulk = new BulkIndexer(esClient, INDEX_TYPE_RULE.getIndex());
bulk.setSize(size);
return bulk;
}
use of org.sonar.server.es.BulkIndexer in project sonarqube by SonarSource.
the class ActiveRuleIndexer method deleteKeys.
private void deleteKeys(List<ActiveRuleKey> keys) {
BulkIndexer bulk = new BulkIndexer(esClient, INDEX_TYPE_ACTIVE_RULE.getIndex());
bulk.start();
SearchRequestBuilder search = esClient.prepareSearch(INDEX_TYPE_ACTIVE_RULE).setQuery(QueryBuilders.boolQuery().must(termsQuery(FIELD_ACTIVE_RULE_KEY, keys)));
bulk.addDeletion(search);
bulk.stop();
}
use of org.sonar.server.es.BulkIndexer in project sonarqube by SonarSource.
the class ActiveRuleIndexer method deleteProfile.
public void deleteProfile(String qualityProfileKey) {
BulkIndexer bulk = new BulkIndexer(esClient, INDEX_TYPE_ACTIVE_RULE.getIndex());
bulk.start();
SearchRequestBuilder search = esClient.prepareSearch(INDEX_TYPE_ACTIVE_RULE).setQuery(QueryBuilders.boolQuery().must(termsQuery(FIELD_ACTIVE_RULE_PROFILE_KEY, qualityProfileKey)));
bulk.addDeletion(search);
bulk.stop();
}
Aggregations