@Override
    public String toString() {
        StringBuilder buffer = new StringBuilder();

        if (shouldParenthesize()) {
            buffer.append("(");
        }
        if (isFilter()) {
            buffer.append("|");
        }
        appendHeadingString(buffer);
        appendBodyString(buffer);
        if (shouldParenthesize()) {
            buffer.append(")");
        }

        if (weight != DEFAULT_WEIGHT) {
            buffer.append("!");
            buffer.append(weight);
        }

        return buffer.toString();
    }
Returns the canonical query language string of this item.
The canonical language represent an item by the string
<pre>
([itemName] [body])
</pre>
where the body may recursively be other items.
container-search/src/main/java/com/yahoo/prelude/query/Item.java