Search in sources :

Example 1 with ParsedTopHits

use of org.graylog.shaded.elasticsearch7.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);
}
Also used : SearchHit(org.elasticsearch.search.SearchHit) ParsedTopHits(org.elasticsearch.search.aggregations.metrics.ParsedTopHits) SearchHits(org.elasticsearch.search.SearchHits)

Aggregations

SearchHit (org.elasticsearch.search.SearchHit)1 SearchHits (org.elasticsearch.search.SearchHits)1 ParsedTopHits (org.elasticsearch.search.aggregations.metrics.ParsedTopHits)1