lib/Elastica/Query.php
public function toArray()
    {
        if (!isset($this->_params['query']) && (0 == $this->_suggest)) {
            $this->setQuery(new MatchAll());
        }

        if (isset($this->_params['post_filter']) && 0 === \count(($this->_params['post_filter'])->toArray())) {
            unset($this->_params['post_filter']);
        }

        $array = $this->_convertArrayable($this->_params);

        if (isset($array['suggest'])) {
            $array['suggest'] = $array['suggest']['suggest'];
        }

        return $array;
    }
public function toArray()
    {
        if (!isset($this->_params['query']) && (0 == $this->_suggest)) {
            $this->setQuery(new MatchAll());
        }

        if (isset($this->_params['post_filter']) && 0 === \count(($this->_params['post_filter'])->toArray())) {
            unset($this->_params['post_filter']);
        }

        $array = $this->_convertArrayable($this->_params);

        if (isset($array['suggest'])) {
            $array['suggest'] = $array['suggest']['suggest'];
        }

        return $array;
    }
public function toArray ( ) { if ( ! isset ( $ this -> _params [ 'query' ] ) && ( 0 == $ this -> _suggest ) ) { $ this -> setQuery ( new MatchAll ( ) ) ; } if ( isset ( $ this -> _params [ 'post_filter' ] ) && 0 === \ count ( ( $ this -> _params [ 'post_filter' ] ) -> toArray ( ) ) ) { unset ( $ this -> _params [ 'post_filter' ] ) ; } $ array = $ this -> _convertArrayable ( $ this -> _params ) ; if ( isset ( $ array [ 'suggest' ] ) ) { $ array [ 'suggest' ] = $ array [ 'suggest' ] [ 'suggest' ] ; } return $ array ; }
Converts all query params to an array.

@return array Query array
Converts all query params to an array .