private void checkPhrases(Item queryItem) {
        if (queryItem instanceof PhraseItem phrase) {
            repeatedConsecutiveTermsInPhraseCheck(phrase);
            repeatedTermsInPhraseCheck(phrase);
        } else  if (queryItem instanceof CompositeItem asComposite) {
            for (ListIterator<Item> i = asComposite.getItemIterator(); i.hasNext();) {
                checkPhrases(i.next());
            }
        }
    }
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