private TopHitsBuilder getTopHitsAggregation ( SelectStatement selectStatement , Integer size , EntityMetadata entityMetadata ) { TopHitsBuilder topHitsBuilder = AggregationBuilders . topHits ( ESConstants . TOP_HITS ) ; if ( size != null ) { topHitsBuilder . setSize ( size ) ; } return topHitsBuilder ; }
Gets the top hits aggregation .