count() public method

Counts results of query.
See also: Elastica\SearchableInterface::count
public count ( string | array | Query $query = '' ) : integer
$query string | array | Query Array with all query data inside or a Elastica\Query object
return integer number of documents matching the query
Example #1
0
 /**
  * @return int
  */
 public function getTotalCount()
 {
     try {
         return $this->index->count();
     } catch (ResponseException $e) {
         return 0;
     }
 }