public function count(Search $search, array $params = [], $returnRaw = false)
    {
        $body = array_merge(
            [
                'index' => $this->getManager()->getIndexName(),
                'type' => $this->type,
                'body' => $search->toArray(),
            ],
            $params
        );

        $results = $this
            ->getManager()
            ->getClient()->count($body);

        if ($returnRaw) {
            return $results;
        } else {
            return $results['count'];
        }
    }
public function count(Search $search, array $params = [], $returnRaw = false)
    {
        $body = array_merge(
            [
                'index' => $this->getManager()->getIndexName(),
                'type' => $this->type,
                'body' => $search->toArray(),
            ],
            $params
        );

        $results = $this
            ->getManager()
            ->getClient()->count($body);

        if ($returnRaw) {
            return $results;
        } else {
            return $results['count'];
        }
    }
public function count ( Search $ search , array $ params = [ ] , $ returnRaw = false ) { $ body = array_merge ( [ 'index' => $ this -> getManager ( ) -> getIndexName ( ) , 'type' => $ this -> type , 'body' => $ search -> toArray ( ) , ] , $ params ) ; $ results = $ this -> getManager ( ) -> getClient ( ) -> count ( $ body ) ; if ( $ returnRaw ) { return $ results ; } else { return $ results [ 'count' ] ; } }
Counts documents by given search.

@param Search $search
@param array  $params
@param bool   $returnRaw If set true returns raw response gotten from client.

@return int|array
Counts documents by given search .