public HashMap<String, Object> rewrite(Query query,
                                           String dictKey) throws RuntimeException {

        Boolean rewritten = false;

        HashMap<String, Object> result = new HashMap<>();
        result.put(RewriterConstants.REWRITTEN, rewritten);
        result.put(RewriterConstants.DICT_KEY, dictKey);

        RewriterUtils.log(logger, query,
                         "In MisspellRewriter");

        // Retrieve flags for enabling the features
        String qssRw = getQPConfig(query, RewriterConstants.QSS_RW);
        String qssSugg = getQPConfig(query, RewriterConstants.QSS_SUGG);

        boolean isQSSRw = false;
        boolean isQSSSugg = false;

        if(qssRw!=null) {
            isQSSRw = qssRw.equalsIgnoreCase("true");
        }
        if(qssSugg!=null) {
            isQSSSugg = qssSugg.equalsIgnoreCase("true");
        }

        // Rewrite is not enabled
        if(!isQSSRw && !isQSSSugg) {
            return result;
        }

        // Retrieve spell corrected query from QLAS
        String rewrites = RewriterUtils.getSpellCorrected(query, isQSSRw, isQSSSugg);

        // No rewrites
        if(rewrites==null) {
            RewriterUtils.log(logger, query, "No rewrite is retrieved");
            return result;
        } else {
            RewriterUtils.log(logger, query, "Retrieved spell corrected query: " +
                              rewrites);
        }

        // Adding rewrite to the query tree
        query = RewriterFeatures.addRewritesAsEquiv(query, dictKey, rewrites, false, 0);

        rewritten = true;
        RewriterUtils.log(logger, query, "MisspellRewriter final query: " +
                          query.toDetailString());

        result.put(RewriterConstants.REWRITTEN, rewritten);
        result.put(RewriterConstants.DICT_KEY, rewrites);

        return result;
    }
Main logic of rewriter<br>
- Retrieve spell corrected query from QLAS<br>
- Add spell corrected query as equiv
container-search/src/main/java/com/yahoo/search/query/rewrite/rewriters/MisspellRewriter.java