static Item convertStringToQTree(Query query, String stringToParse) {
        RewriterUtils.log(logger, query, "Converting string [" + stringToParse + "] to query tree");
        if (stringToParse == null) {
            return new NullItem();
        }
        Model model = query.getModel();
        CustomParser parser = (CustomParser) ParserFactory.newInstance(model.getType(),
                ParserEnvironment.fromExecutionContext(query.getModel().getExecution().context()));
        IndexFacts indexFacts = new IndexFacts();
        Item item = parser.parse(stringToParse, null, model.getParsingLanguage(),
                                 indexFacts.newSession(model.getSources(), model.getRestrict()),
                                 model.getDefaultIndex());
        RewriterUtils.log(logger, query, "Converted string: [" + item.toString() + "]");
        return item;
    }
Parses a string into a tree of query items.

@param stringToParse the string to be converted to a query tree
@param query Query object supplying context to this parsing
@return Item the resulting query tree
container-search/src/main/java/com/yahoo/search/query/rewrite/RewriterFeatures.java