private static CanonicalizationResult recursivelyCanonicalize(Item item, ListIterator<Item> parentIterator) {
        // children first as they may be removed
        if (item instanceof CompositeItem composite) {
            for (ListIterator<Item> i = composite.getItemIterator(); i.hasNext(); ) {
                CanonicalizationResult childResult = recursivelyCanonicalize(i.next(), i);
                if (childResult.isError()) return childResult;
            }
        }

        return canonicalizeThis(item, parentIterator);
    }
Canonicalize this query

@param item the item to canonicalize
@param parentIterator iterator for the parent of this item, never null
@return result of canonicalization
container-search/src/main/java/com/yahoo/prelude/query/QueryCanonicalizer.java