public function getSearchGroupingHighestGroupResultsLimit($defaultIfEmpty = 1)
    {
        $groupingConfiguration = $this->getObjectByPathOrDefault('plugin.tx_solr.search.grouping.', []);
        $highestLimit = $defaultIfEmpty;
        if (!empty($groupingConfiguration['numberOfResultsPerGroup'])) {
            $highestLimit = $groupingConfiguration['numberOfResultsPerGroup'];
        }

        $configuredGroups = $groupingConfiguration['groups.'];
        if (!is_array($configuredGroups)) {
            return $highestLimit;
        }

        foreach ($configuredGroups as $groupName => $groupConfiguration) {
            if (!empty($groupConfiguration['numberOfResultsPerGroup']) && $groupConfiguration['numberOfResultsPerGroup'] > $highestLimit) {
                $highestLimit = $groupConfiguration['numberOfResultsPerGroup'];
            }
        }

        return $highestLimit;
    }