Returns the count of the returned entries
from the specified search results.

@param $searchResults

@return int
3299
public function countEntries($searchResults)
    {
        if ($this->suppressErrors) {
            return @ldap_count_entries($this->getConnection(), $searchResults);
        }

        return ldap_count_entries($this->getConnection(), $searchResults);
    }
1234860
public function getNbResults()
    {
        if (isset($this->nbResults)) {
            return $this->nbResults;
        }

        return $this->nbResults = $this->getSearchResultWithLimitZero()->totalCount;
    }
838930
public function buildListFromSearchResult(SearchResult $searchResult)
    {
        $list = array();
        foreach ($searchResult->searchHits as $searchHit) {
            $list[$searchHit->valueObject->id] = $searchHit->valueObject;
        }

        return $list;
    }
516261
public function count(array $locales = null,  array $filters = null)
    {
        $builder = $this->createQueryBuilder();

        $this->addTransUnitFilters($builder, $filters);
        $this->addTranslationFilter($builder, $locales, $filters);

        $count = $builder->count()
            ->getQuery()
            ->execute();

        return $count;
    }
1338162
protected function getInitializedSearchResultSet(SearchRequest $searchRequest):SearchResultSet
    {
        /** @var $resultSet SearchResultSet */
        $resultSetClass = $this->getResultSetClassName();
        $resultSet = GeneralUtility::makeInstance($resultSetClass);

        $resultSet->setUsedSearchRequest($searchRequest);
        $resultSet->setUsedPage((int)$searchRequest->getPage());
        $resultSet->setUsedResultsPerPage((int)$searchRequest->getResultsPerPage());
        $resultSet->setUsedSearch($this->search);
        return $resultSet;
    }
904880
public function getTopBrowsers($numberOfDays = 365, $maxResults = 6)
    {
        list($startDate, $endDate) = $this->calculateNumberOfDays($numberOfDays);

        return $this->getTopBrowsersForPeriod($startDate, $endDate, $maxResults);
    }
764065
public function count(array $locales = null,  array $filters = null)
    {
        $query = TransUnitQuery::create()
            ->select('Id')
            ->distinct()
        ;

        $this->addTransUnitFilters($query, $filters);
        $this->addTranslationFilter($query, $locales, $filters);

        return $query->count($this->getConnection());
    }
1223300
public function updateSearchResults(&$results, &$properties)
    {
        // Customise empty results
        $customNoSearchResultsText = SiteConfig::current_site_config()->NoSearchResults;
        if ($customNoSearchResultsText) {
            $properties['NoSearchResults'] = $customNoSearchResultsText;
        }

        // Customise empty search
        $customEmptyText = SiteConfig::current_site_config()->EmptySearch;
        if ($customEmptyText) {
            $properties['EmptySearch'] = $customEmptyText;
        }
    }
1139252
private function getTotalsForAllResults(&$results) {

    $rowCount = count($results->getRows());
    $totalResults = $results->getTotalResults();

    $html = '<h3>Total Metrics For All Results</h3>';
    $html .= "<p>This query returned $rowCount rows. <br>";
    $html .= "But the query matched $totalResults total results. <br>";
    $html .= 'Here are the metric totals for the matched results.</p>';
    $html .= '<pre>';

    $totals = $results->getTotalsForAllResults();
    foreach ($totals as $metricName => $metricTotal) {
      $html .= "Metric Name  = $metricName\n";
      $html .= "Metric Total = $metricTotal";
    }
    $html .= '</pre>';
    return $html;
  }
1321925
public function search($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['tag'])) {
            $vars = array(
                'method' => 'tag.search',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                $opensearch = $call->results->children('http://a9.com/-/spec/opensearch/1.1/');
                if ($opensearch->totalResults > 0) {
                    $searchResults['totalResults'] = (string) $opensearch->totalResults;
                    $searchResults['startIndex'] = (string) $opensearch->startIndex;
                    $searchResults['itemsPerPage'] = (string) $opensearch->itemsPerPage;
                    $i = 0;
                    foreach ($call->results->tagmatches->tag as $tag) {
                        $searchResults['results'][$i]['name'] = (string) $tag->name;
                        $searchResults['results'][$i]['count'] = (string) $tag->count;
                        $searchResults['results'][$i]['url'] = (string) $tag->url;
                        $i++;
                    }
                    return $searchResults;
                } else {
                    throw new NoResultsException('No results');
                }
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include tag variable in the call for this method');
        }
    }
1024880
private function batchesFinished($batchesResult)
    {
        $allfinished = true;
        foreach ($batchesResult as $key => $batch) {
            if ($batch['Status'] != 'Completed') {
                $allfinished = false;
            }
        }
        return $allfinished;
    }
445435
public function getSearchEngines($parameters = [], $parseResult = true)
    {
        $this->setParams([
            'metrics'    => 'ga:pageviews,ga:sessionDuration,ga:exits',
            'dimensions' => 'ga:source',
            'filters'    => 'ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga:medium==cpv,ga:medium==organic,ga:medium==ppc',
            'sort'       => '-ga:pageviews',
        ]);

        return $this->execute($parameters, $parseResult);
    }
87046
public function GetCount($Wheres = '') {
      $this->_BeforeGet();
      
      $this->SQL
         ->Select('*', 'count', 'Count')
         ->From($this->Name);

      if (is_array($Wheres))
         $this->SQL->Where($Wheres);

      $Data = $this->SQL
         ->Get()
         ->FirstRow();

      return $Data === FALSE ? 0 : $Data->Count;
   }
64036
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;
    }
342200
public function searchContentfulEntriesCount(string $searchText, ?Client $client = null): int
    {
        $client = $client ?? $this->defaultClient;

        $query = new Query();
        $query->where('query', $searchText);

        return count($client->getEntries($query));
    }
1284233
public function search(SearchRequest $searchRequest)
    {
        $resultSet = $this->getInitializedSearchResultSet($searchRequest);
        $this->lastResultSet = $resultSet;

        $resultSet = $this->handleSearchHook('beforeSearch', $resultSet);
        if ($this->shouldReturnEmptyResultSetWithoutExecutedSearch($searchRequest)) {
            $resultSet->setHasSearched(false);
            return $resultSet;
        }

        $query = $this->queryBuilder->buildSearchQuery($searchRequest->getRawUserQuery(), (int)$searchRequest->getResultsPerPage(), $searchRequest->getAdditionalFilters());
        $this->initializeRegisteredSearchComponents($query, $searchRequest);
        $resultSet->setUsedQuery($query);

        // performing the actual search, sending the query to the Solr server
        $query = $this->modifyQuery($query, $searchRequest, $this->search);
        $response = $this->doASearch($query, $searchRequest);

        if ((int)$searchRequest->getResultsPerPage() === 0) {
            // when resultPerPage was forced to 0 we also set the numFound to 0 to hide results, e.g.
            // when results for the initial search should not be shown.
            $response->response->numFound = 0;
        }

        $resultSet->setHasSearched(true);
        $resultSet->setResponse($response);

        $this->getParsedSearchResults($resultSet);

        $resultSet->setUsedAdditionalFilters($this->queryBuilder->getAdditionalFilters());

        /** @var $variantsProcessor VariantsProcessor */
        $variantsProcessor = GeneralUtility::makeInstance(
            VariantsProcessor::class,
            /** @scrutinizer ignore-type */ $this->typoScriptConfiguration,
            /** @scrutinizer ignore-type */ $this->searchResultBuilder
        );
        $variantsProcessor->process($resultSet);

        /** @var $searchResultReconstitutionProcessor ResultSetReconstitutionProcessor */
        $searchResultReconstitutionProcessor = GeneralUtility::makeInstance(ResultSetReconstitutionProcessor::class);
        $searchResultReconstitutionProcessor->process($resultSet);

        $resultSet = $this->getAutoCorrection($resultSet);

        return $this->handleSearchHook('afterSearch', $resultSet);
    }
1067785
public function count()
    {
        if ($this->numberOfResults === null) {
            if (is_array($this->queryResult)) {
                $this->numberOfResults = count($this->queryResult);
            } else {
                $this->numberOfResults = $this->persistenceManager->getObjectCountByQuery($this->query);
            }
        }
        return $this->numberOfResults;
    }