@Override
    public Result search(Query query, Execution execution) {
        if (execution.context().getIndexFacts() == null) return execution.search(query); // this is a test query

        boolean optimized = recursiveOptimize(query.getModel().getQueryTree(), execution.context().getIndexFacts().newSession(query));
        if (optimized)
            query.trace("Optimized query ranges", true, 2);
        return execution.search(query);
    }
Finds and optimizes ranges in queries:
For single value attributes c1 $lt; x AND x &gt; c2  becomes  x IN &lt;c1; c2&gt;.
The query cost saving from this has been shown to be 2 orders of magnitude in real cases.

@author bratseth
container-search/src/main/java/com/yahoo/search/querytransform/RangeQueryOptimizer.java