protected function get_response_counts($response) {
        $found = 0;
        $included = 0;

        if (isset($response->grouped->solr_filegroupingid->ngroups)) {
            // Get the number of results for file grouped queries.
            $found = $response->grouped->solr_filegroupingid->ngroups;
            $included = count($response->grouped->solr_filegroupingid->groups);
        } else if (isset($response->response->numFound)) {
            // Get the number of results for standard queries.
            $found = $response->response->numFound;
            if ($found > 0 && is_array($response->response->docs)) {
                $included = count($response->response->docs);
            }
        }

        return array($included, $found);
    }