Sulu\Bundle\SearchBundle\Controller\SearchController::getIndexTotals PHP Method

getIndexTotals() private method

Return the category totals for the search results.
private getIndexTotals ( $hits ) : array
return array
    private function getIndexTotals($hits)
    {
        $indexNames = $this->searchManager->getIndexNames();
        $indexCount = array_combine($indexNames, array_fill(0, count($indexNames), 0));
        foreach ($hits as $hit) {
            ++$indexCount[$hit->getDocument()->getIndex()];
        }
        return $indexCount;
    }