use of org.elasticsearch.search.aggregations.metrics.ParsedTopHits in project sonarqube by SonarSource.
the class ComponentIndex method bucketToQualifier.
private static ComponentHitsPerQualifier bucketToQualifier(ParsedFilters.ParsedBucket bucket) {
ParsedTopHits docs = bucket.getAggregations().get(DOCS_AGGREGATION_NAME);
SearchHits hitList = docs.getHits();
SearchHit[] hits = hitList.getHits();
return new ComponentHitsPerQualifier(bucket.getKey(), ComponentHit.fromSearchHits(hits), getTotalHits(hitList.getTotalHits()).value);
}
Aggregations