private boolean equalIndexNameIfParentIsPhrase(List<Item> items, CompositeItem parent) {
        if ( ! (parent instanceof PhraseItem phrase)) return true;

        for (Item item : items) {
            if ( ! (item instanceof IndexedItem indexedItem)) continue;
            if (! indexedItem.getIndexName().equals(phrase.getIndexName())) return false;
        }
        return true;
    }
A special purpose check used to simplify the above
container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java