protected function __query($index, $type = null, array $query = []) {
        $result = $this->client->search([
            'index' => $index,
            'body' => array_merge_recursive($query, $this->additionalQuery())
                ] + ($type ? ['type' => $type] : []));
        return $this->_makeResult($result);
    }
protected function __query($index, $type = null, array $query = []) {
        $result = $this->client->search([
            'index' => $index,
            'body' => array_merge_recursive($query, $this->additionalQuery())
                ] + ($type ? ['type' => $type] : []));
        return $this->_makeResult($result);
    }
protected function __query ( $ index , $ type = null , array $ query = [ ] ) { $ result = $ this -> client -> search ( [ 'index' => $ index , 'body' => array_merge_recursive ( $ query , $ this -> additionalQuery ( ) ) ] + ( $ type ? [ 'type' => $ type ] : [ ] ) ) ; return $ this -> _makeResult ( $ result ) ; }
The actual method to call client's search method.
Returns Result object

@param string $index
@param string $type if null, then all types will be searched
@param array $query
@return Result|Model[]
The actual method to call client s search method . Returns Result object