private CompositeItem convertSegmentItem(CompositeItem item) {
        if (!(item instanceof SegmentItem)) {
            return item;
        }
        CompositeItem converted;
        if (item instanceof AndSegmentItem) {
            converted = new AndItem();
        } else if (item instanceof PhraseSegmentItem old) {
            PhraseItem p = new PhraseItem();
            p.setIndexName(old.getIndexName());
            converted = p;
        } else {
            // TODO: Do something else than nothing for unknowns?
            return item;
        }
        for (Iterator<Item> i = item.getItemIterator(); i.hasNext();) {
            converted.addItem(i.next());
        }
        return converted;
    }
Convert segment items into their mutable counterpart, do not update query tree.
Non-segment items are returned directly.

@return a mutable CompositeItem instance
container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java