private static Map<String, String> createModelMap(Query query) {
        Map<String, String> m = new HashMap<>();
        if (query.getModel().getSearchPath() != null) m.put("searchpath", query.getModel().getSearchPath());

        int traceLevel = ProtobufSerialization.getTraceLevelForBackend(query);
        if (traceLevel > 0) m.put("tracelevel", String.valueOf(traceLevel));

        return m;
    }
Encodes properties of this query.

@param buffer the buffer to encode to
@return the encoded length
container-search/src/main/java/com/yahoo/vespa/streamingvisitors/QueryEncoder.java