src/Search/Search.php
public function count(): int
    {
        $collection = $this->documentManager->getCollection($this->documentClass);

        return $collection->count($this->query);
    }
public function count(): int
    {
        $collection = $this->documentManager->getCollection($this->documentClass);

        return $collection->count($this->query);
    }
public function count ( ) : int { $ collection = $ this -> documentManager -> getCollection ( $ this -> documentClass ) ; return $ collection -> count ( $ this -> query ) ; }
Get the total hits of the current query.

@return int
Get the total hits of the current query .