src/ElasticSearch/DSL/Stringify.php
protected function transformDSLTermToString($dslTerm) {
        $string = "";
        if (is_array($dslTerm)) {
            $key = key($dslTerm);
            $value = $dslTerm[$key];
            if (is_string($key))
                $string .= "$key:";
        }
        else
            $value = $dslTerm;
        /**
         * If a specific key is used as key in the array
         * this should translate to searching in a specific field (field:term)
         */
        if (strpos($value, " ") !== false)
            $string .= '"' . $value . '"';
        else
            $string .= $value;
        return $string;
    }
protected function transformDSLTermToString($dslTerm) {
        $string = "";
        if (is_array($dslTerm)) {
            $key = key($dslTerm);
            $value = $dslTerm[$key];
            if (is_string($key))
                $string .= "$key:";
        }
        else
            $value = $dslTerm;
        /**
         * If a specific key is used as key in the array
         * this should translate to searching in a specific field (field:term)
         */
        if (strpos($value, " ") !== false)
            $string .= '"' . $value . '"';
        else
            $string .= $value;
        return $string;
    }
A naive transformation of possible term and wildcard arrays in a DSL
query

@return string
@param mixed $dslTerm