private static void annotatedTerm(StringBuilder destination, IndexedItem w, String annotations) {
        if (!annotations.isEmpty()) {
            destination.append("({").append(annotations).append("}");
        }
        destination.append('"');
        escape(w.getIndexedString(), destination).append('"');
        if (!annotations.isEmpty()) {
            destination.append(')');
        }
    }
Adds annotations and returns whether any were added
container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java