static boolean serialize(StringBuilder destination, AndSegmentItem item, boolean includeField) {
            Substring origin = item.getOrigin();
            String image;
            int offset;
            int length;

            if (origin == null) {
                image = item.getRawWord();
                offset = 0;
                length = image.length();
            } else {
                image = origin.getSuperstring();
                offset = origin.start;
                length = origin.end - origin.start;
            }

            if (includeField) {
                destination.append(normalizeIndexName(item.getIndexName())).append(" contains ");
            }
            destination.append("({");
            serializeOrigin(destination, image, offset, length);
            destination.append(", ").append(AND_SEGMENTING).append(": true");
            destination.append("}");
            destination.append(PHRASE).append('(');
            serializeWords(destination, item);
            destination.append("))");
            return false;
        }
Serialize Vespa query trees to YQL+ strings.

@author Steinar Knutsen
container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java