public static HashMap<String, Object> getRewriteMeta(Query query) {
       log(utilsLogger, query, "Retrieving metadata passed by previous rewriter");

        @SuppressWarnings("unchecked")
        HashMap<String, Object> rewriteMeta =
                (HashMap<String, Object>)query.properties().get(RewriterConstants.REWRITE_META);

       if (rewriteMeta == null) {
           log(utilsLogger, query, "No metadata available from previous rewriter");
           rewriteMeta = new HashMap<>();
           rewriteMeta.put(RewriterConstants.REWRITTEN, false);
           rewriteMeta.put(RewriterConstants.DICT_KEY, getNormalizedOriginalQuery(query));
       } else {
           if((Boolean)rewriteMeta.get(RewriterConstants.REWRITTEN)) {
               log(utilsLogger, query, "Query has been rewritten by previous rewriters");
           } else {
               log(utilsLogger, query, "Query has not been rewritten by previous rewriters");
           }
           log(utilsLogger, query, "Dict key passed by previous rewriter: " +
                                   rewriteMeta.get(RewriterConstants.DICT_KEY));
       }

       return rewriteMeta;
    }
Retrieve metadata passed by previous rewriter from query properties
Initialize values if this is the first rewriter

@param query Query object from the searcher
@return hashmap containing the metadata
container-search/src/main/java/com/yahoo/search/query/rewrite/RewriterUtils.java