aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-10-16 17:24:40 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-10-19 14:31:06 +0200
commit626904d85efc720c070885b19cb74ee86f4ecc8d (patch)
tree930aba5484886471c8ee765f54921442a3c15629 /server/sonar-server
parent5712c5f19c0d537999b3154b8aea9c42f4587c1c (diff)
downloadsonarqube-626904d85efc720c070885b19cb74ee86f4ecc8d.tar.gz
sonarqube-626904d85efc720c070885b19cb74ee86f4ecc8d.zip
Improve ES request for facets resolutions, status and severities
When no values are selected, then the term aggregation should not be filtered on all possible values. This filtering is useless and decreases performances by 20% on my 25-millions-issues instance.
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index 07651b46cb3..e4a826d46f6 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -381,9 +381,9 @@ public class IssueIndex extends BaseIndex {
StickyFacetBuilder stickyFacetBuilder = newStickyFacetBuilder(query, filters, esQuery);
// Execute Term aggregations
addSimpleStickyFacetIfNeeded(options, stickyFacetBuilder, esSearch,
- IssueFilterParameters.SEVERITIES, IssueIndexDefinition.FIELD_ISSUE_SEVERITY, Severity.ALL.toArray());
+ IssueFilterParameters.SEVERITIES, IssueIndexDefinition.FIELD_ISSUE_SEVERITY);
addSimpleStickyFacetIfNeeded(options, stickyFacetBuilder, esSearch,
- IssueFilterParameters.STATUSES, IssueIndexDefinition.FIELD_ISSUE_STATUS, Issue.STATUSES.toArray());
+ IssueFilterParameters.STATUSES, IssueIndexDefinition.FIELD_ISSUE_STATUS);
addSimpleStickyFacetIfNeeded(options, stickyFacetBuilder, esSearch,
IssueFilterParameters.PROJECT_UUIDS, IssueIndexDefinition.FIELD_ISSUE_PROJECT_UUID, query.projectUuids().toArray());
addSimpleStickyFacetIfNeeded(options, stickyFacetBuilder, esSearch,
@@ -582,7 +582,7 @@ public class IssueIndex extends BaseIndex {
StickyFacetBuilder assigneeFacetBuilder = newStickyFacetBuilder(query, resolutionFilters, esQuery);
BoolFilterBuilder facetFilter = assigneeFacetBuilder.getStickyFacetFilter(fieldName);
FilterAggregationBuilder facetTopAggregation = assigneeFacetBuilder.buildTopFacetAggregation(fieldName, facetName, facetFilter, DEFAULT_FACET_SIZE);
- facetTopAggregation = assigneeFacetBuilder.addSelectedItemsToFacet(fieldName, facetName, facetTopAggregation, Issue.RESOLUTIONS.toArray());
+ facetTopAggregation = assigneeFacetBuilder.addSelectedItemsToFacet(fieldName, facetName, facetTopAggregation);
// Add missing facet for unresolved issues
facetTopAggregation.subAggregation(