code: private TopHitsBuilder getTopHitsAggregation(SelectStatement selectStatement, Integer size,
              EntityMetadata entityMetadata)
      {
          TopHitsBuilder topHitsBuilder = AggregationBuilders.topHits(ESConstants.TOP_HITS);
          if (size != null)
          {
              topHitsBuilder.setSize(size);
          }
  
          return topHitsBuilder;
      }
docs: Gets the top hits aggregation.
  
  @param selectStatement
  the select statement
  @param size
  the size
  @param entityMetadata
  the entity metadata
  @return the top hits aggregation