diff options
author | Daniel Schwarz <daniel.schwarz@sonarsource.com> | 2017-07-19 15:54:22 +0200 |
---|---|---|
committer | Daniel Schwarz <bartfastiel@users.noreply.github.com> | 2017-08-09 15:09:54 +0200 |
commit | ce0cb8c998dca1b19eed284b3c06ba23507c900d (patch) | |
tree | b20632ebfb1c9c8cf18bfa991ef7326b1745659d | |
parent | fbe24b6c5cfed2add6df314966ed72655f967b60 (diff) | |
download | sonarqube-ce0cb8c998dca1b19eed284b3c06ba23507c900d.tar.gz sonarqube-ce0cb8c998dca1b19eed284b3c06ba23507c900d.zip |
SONAR-8798 fix quality gate status facet of project measures index
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectMeasuresIndex.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectMeasuresIndex.java b/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectMeasuresIndex.java index 960ab8b3014..56196237dd4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectMeasuresIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectMeasuresIndex.java @@ -37,7 +37,7 @@ import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket; -import org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregator; +import org.elasticsearch.search.aggregations.bucket.filters.FiltersAggregator.KeyedFilter; import org.elasticsearch.search.aggregations.bucket.range.RangeAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; @@ -264,19 +264,19 @@ public class ProjectMeasuresIndex { .subAggregation( AggregationBuilders.filter("filter_" + metricKey, termsQuery(FIELD_MEASURES_KEY, metricKey)) .subAggregation(filters(metricKey, - new FiltersAggregator.KeyedFilter("1", termQuery(FIELD_MEASURES_VALUE, 1d)), - new FiltersAggregator.KeyedFilter("2", termQuery(FIELD_MEASURES_VALUE, 2d)), - new FiltersAggregator.KeyedFilter("3", termQuery(FIELD_MEASURES_VALUE, 3d)), - new FiltersAggregator.KeyedFilter("4", termQuery(FIELD_MEASURES_VALUE, 4d)), - new FiltersAggregator.KeyedFilter("5", termQuery(FIELD_MEASURES_VALUE, 5d))))); + new KeyedFilter("1", termQuery(FIELD_MEASURES_VALUE, 1d)), + new KeyedFilter("2", termQuery(FIELD_MEASURES_VALUE, 2d)), + new KeyedFilter("3", termQuery(FIELD_MEASURES_VALUE, 3d)), + new KeyedFilter("4", termQuery(FIELD_MEASURES_VALUE, 4d)), + new KeyedFilter("5", termQuery(FIELD_MEASURES_VALUE, 5d))))); } private static AbstractAggregationBuilder createQualityGateFacet() { return AggregationBuilders.filters( ALERT_STATUS_KEY, QUALITY_GATE_STATUS.entrySet().stream() - .map(entry -> termQuery(FIELD_QUALITY_GATE_STATUS, entry.getValue())) - .toArray(QueryBuilder[]::new)); + .map(entry -> new KeyedFilter(entry.getKey(), termQuery(FIELD_QUALITY_GATE_STATUS, entry.getValue()))) + .toArray(KeyedFilter[]::new)); } private Map<String, QueryBuilder> createFilters(ProjectMeasuresQuery query) { |