Classes/Eel/ElasticSearchQueryBuilder.php
public function count()
    {
        $timeBefore = microtime(true);
        $request = $this->getRequest()->getCountRequestAsJson();

        $response = $this->elasticSearchClient->getIndex()->request('GET', '/_count', [], $request);
        $timeAfterwards = microtime(true);

        $treatedContent = $response->getTreatedContent();
        $count = $treatedContent['count'];

        $this->logThisQuery && $this->logger->log('Count Query Log (' . $this->logMessage . '): ' . $request . ' -- execution time: ' . (($timeAfterwards - $timeBefore) * 1000) . ' ms -- Total Results: ' . $count, LOG_DEBUG);

        return $count;
    }
public function count()
    {
        $timeBefore = microtime(true);
        $request = $this->getRequest()->getCountRequestAsJson();

        $response = $this->elasticSearchClient->getIndex()->request('GET', '/_count', [], $request);
        $timeAfterwards = microtime(true);

        $treatedContent = $response->getTreatedContent();
        $count = $treatedContent['count'];

        $this->logThisQuery && $this->logger->log('Count Query Log (' . $this->logMessage . '): ' . $request . ' -- execution time: ' . (($timeAfterwards - $timeBefore) * 1000) . ' ms -- Total Results: ' . $count, LOG_DEBUG);

        return $count;
    }
public function count ( ) { $ timeBefore = microtime ( true ) ; $ request = $ this -> getRequest ( ) -> getCountRequestAsJson ( ) ; $ response = $ this -> elasticSearchClient -> getIndex ( ) -> request ( 'GET' , '/_count' , [ ] , $ request ) ; $ timeAfterwards = microtime ( true ) ; $ treatedContent = $ response -> getTreatedContent ( ) ; $ count = $ treatedContent [ 'count' ] ; $ this -> logThisQuery && $ this -> logger -> log ( 'Count Query Log (' . $ this -> logMessage . '): ' . $ request . ' -- execution time: ' . ( ( $ timeAfterwards - $ timeBefore ) * 1000 ) . ' ms -- Total Results: ' . $ count , LOG_DEBUG ) ; return $ count ; }
Return the total number of hits for the query.

@return integer
@throws \Flowpack\ElasticSearch\Exception
@api
Return the total number of hits for the query .