private static Map<String, Boolean> createCacheSettingMap(Query query) {
        if (query.getGroupingSessionCache() && query.getRanking().getQueryCache()) {
            Map<String, Boolean> cacheSettingMap = new HashMap<>();
            cacheSettingMap.put("grouping", true);
            cacheSettingMap.put("query", true);
            return cacheSettingMap;
        }
        if (query.getGroupingSessionCache())
            return Map.of("grouping", true);
        if (query.getRanking().getQueryCache())
            return Map.of("query", true);
        return Map.of();
    }
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