public Grouping setTopN(long topN) {
        this.topN = topN;
        return this;
    }
Sets the number of candidate documents to group.

@param topN the number to set
@return this, to allow chaining
searchlib/src/main/java/com/yahoo/searchlib/aggregation/Grouping.java