protected function createMatchQuery($expression, array $fields = [])
    {
        if (0 == strlen($expression)) {
            return new Query\MatchAll();
        }

        if (empty($fields)) {
            $fields = $this->getDefaultMatchFields();
        }

        $query = new Query\MultiMatch();
        $query
            ->setQuery($expression)
            ->setFields($fields);

        return $query;
    }
protected function createMatchQuery($expression, array $fields = [])
    {
        if (0 == strlen($expression)) {
            return new Query\MatchAll();
        }

        if (empty($fields)) {
            $fields = $this->getDefaultMatchFields();
        }

        $query = new Query\MultiMatch();
        $query
            ->setQuery($expression)
            ->setFields($fields);

        return $query;
    }
protected function createMatchQuery ( $ expression , array $ fields = [ ] ) { if ( 0 == strlen ( $ expression ) ) { return new Query \ MatchAll ( ) ; } if ( empty ( $ fields ) ) { $ fields = $ this -> getDefaultMatchFields ( ) ; } $ query = new Query \ MultiMatch ( ) ; $ query -> setQuery ( $ expression ) -> setFields ( $ fields ) ; return $ query ; }
Creates the match query.

@param string $expression
@param array  $fields

@return Query\AbstractQuery
Creates the match query .