public GroupingLevel setMaxGroups(long max) {
        maxGroups = max;
        if (precision < maxGroups) {
            precision = maxGroups;
        }
        return this;
    }
Sets the maximum number of groups allowed at this level.
searchlib/src/main/java/com/yahoo/searchlib/aggregation/GroupingLevel.java