Elastica\ResultSet::getTotalHits PHP Method

getTotalHits() public method

Returns the total number of found hits.
public getTotalHits ( ) : integer
return integer Total hits
    public function getTotalHits()
    {
        $data = $this->_response->getData();
        return isset($data['hits']['total']) ? (int) $data['hits']['total'] : 0;
    }

Usage Example

 /**
  * @return int
  */
 public function count()
 {
     if (null === $this->resultSet) {
         $this->search();
     }
     return $this->resultSet->getTotalHits();
 }
All Usage Examples Of Elastica\ResultSet::getTotalHits