private int countSingleCharacterUserTerms(Item queryItem) {
        if (queryItem instanceof CompositeItem asComposite) {
            int sum = 0;
            for (ListIterator<Item> i = asComposite.getItemIterator(); i.hasNext();) {
                sum += countSingleCharacterUserTerms(i.next());
            }
            return sum;
        } else if (queryItem instanceof WordItem word) {
            return (word.isFromQuery() && word.stringValue().length() == 1) ? 1 : 0;
        } else {
            return 0;
        }
    }
Check whether the query tree seems to be "well formed". In other words, run heuristics against
the input data to see whether the query should sent to the search backend.

@author Steinar Knutsen
container-search/src/main/java/com/yahoo/search/searchers/InputCheckingSearcher.java