Search in sources :

Example 6 with StickyFacetBuilder

use of org.sonar.server.es.StickyFacetBuilder in project sonarqube by SonarSource.

the class ProjectMeasuresIndex method addFacets.

private static void addFacets(SearchRequestBuilder esSearch, SearchOptions options, Map<String, QueryBuilder> filters, ProjectMeasuresQuery query) {
    StickyFacetBuilder facetBuilder = new StickyFacetBuilder(matchAllQuery(), filters);
    options.getFacets().stream().filter(FACET_FACTORIES::containsKey).map(FACET_FACTORIES::get).forEach(factory -> factory.addFacet(esSearch, query, facetBuilder));
}
Also used : StickyFacetBuilder(org.sonar.server.es.StickyFacetBuilder)

Aggregations

StickyFacetBuilder (org.sonar.server.es.StickyFacetBuilder)6 BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)3 FilterAggregationBuilder (org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder)3 QueryBuilder (org.elasticsearch.index.query.QueryBuilder)2 HashMap (java.util.HashMap)1 AbstractAggregationBuilder (org.elasticsearch.search.aggregations.AbstractAggregationBuilder)1