private List onIterateBuckets ( Terms buckets , KunderaQuery query , MetamodelImpl metaModel , Class clazz , EntityMetadata entityMetadata ) { List temp , results = new ArrayList <> ( ) ; for ( Terms . Bucket entry : buckets . getBuckets ( ) ) { logger . debug ( "key [{}], doc_count [{}]" , entry . getKey ( ) , entry . getDocCount ( ) ) ; Aggregations aggregations = entry . getAggregations ( ) ; TopHits topHits = aggregations . get ( ESConstants . TOP_HITS ) ; temp = buildRecords ( ( InternalAggregations ) aggregations , topHits . getHits ( ) , query , metaModel , clazz , entityMetadata ) ; results . add ( temp . size ( ) == 1 ? temp . get ( 0 ) : temp ) ; } return results ; }
On iterate buckets .