private boolean recursiveOptimize(Item item, IndexFacts.Session indexFacts) {
        if ( ! (item instanceof CompositeItem)) return false;

        boolean optimized = false;
        for (Iterator<Item> i = ((CompositeItem) item).getItemIterator(); i.hasNext(); )
            optimized |= recursiveOptimize(i.next(), indexFacts);

        if (item instanceof AndItem)
            optimized |= optimizeAnd((AndItem)item, indexFacts);
        return optimized;
    }
Recursively performs the range optimization on this query tree and returns whether at least one optimization was done
container-search/src/main/java/com/yahoo/search/querytransform/RangeQueryOptimizer.java