protected CompositeItem newComposite() {
        return switch (environment.getType().getComposite()) {
            case and     -> new AndItem();
            case or      -> new OrItem();
            case phrase  -> new PhraseItem();
            case weakAnd -> new WeakAndItem();
        };
    }
Creates a new composite of the type specified in environment.getType().getComposite().
container-search/src/main/java/com/yahoo/prelude/query/parser/AbstractParser.java