public HitsAggregationResult setMaxHits(int maxHits) {
        this.maxHits = maxHits;
        return this;
    }
Sets the maximum number of hits to collect.

@param maxHits the number of hits to collect.
@return this, to allow chaining.
searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java