@Override
    public Result search(Query query, Execution execution) {
        if (query.properties().getBoolean(DISABLE)) return execution.search(query);

        IndexFacts.Session indexFacts = execution.context().getIndexFacts().newSession(query);
        Item newRoot = replaceTerms(query, indexFacts);
        query.getModel().getQueryTree().setRoot(newRoot);

        query.trace(getFunctionName(), true, 2);

        Highlight highlight = query.getPresentation().getHighlight();
        if (highlight != null) {
            Set<String> highlightFields = highlight.getHighlightItems().keySet();
            for (String field : highlightFields) {
                StemMode stemMode = indexFacts.getIndex(field).getStemMode();
                if (stemMode != StemMode.NONE) {
                    StemContext context = new StemContext();
                    context.language = Language.ENGLISH;
                    context.indexFacts = indexFacts;
                    Item newHighlight = scan(highlight.getHighlightItems().get(field), context);
                    highlight.getHighlightItems().put(field, (AndItem)newHighlight);
                }
            }
        }
        return execution.search(query);
    }
Replaces query terms with their stems

@author Mathias Lidal
@author bratseth
@author Steinar Knutsen
container-search/src/main/java/com/yahoo/prelude/querytransform/StemmingSearcher.java