@Override
    public Result search(Query query, Execution execution) {
        if (query.getHits() > WeakAndItem.defaultN) {
            adjustWeakAndHeap(query.getModel().getQueryTree().getRoot(), query.getHits());
        }
        if (!query.properties().getBoolean(OPPORTUNISTIC_AND)) {
            return execution.search(query);
        }

        Item originalRoot = query.getModel().getQueryTree().getRoot();
        int targetHits = (int)(targetHits(originalRoot) * query.properties().getDouble(OPPORTUNISTIC_FACTOR, 1.0));
        if (targetHits >= 0) {
            query.getModel().getQueryTree().setRoot(weakAnd2AndRecurse(originalRoot.clone()));
            query.trace("WeakAND(" + targetHits+ ") => AND", true, 2);
            Result result = execution.search(query);
            if (result.getTotalHitCount() >= targetHits) {
                return result;
            }
            query.getModel().getQueryTree().setRoot(originalRoot);
            query.trace("Fallback to WeakAND(" + targetHits+ ") as AND => " + result, true, 2);
            return execution.search(query);
        }
        return execution.search(query);
    }
Will opportunistically replace the WeakAND with an AND as it is faster.
If enough hits are returned all is good and we return. If not we fall back to the original query.
It is default off, and is enabled with weakAnd.opportunistic.and=true.
It can be tuned with weakAnd.opportunistic.factor. Higher value than 1 might increase quality, lower value will
improve performance. Default is 1.0. This factor is multiplied with the heap size of the wand(default 100) as target hits.

@author baldersheim
container-search/src/main/java/com/yahoo/search/searchers/OpportunisticWeakAndSearcher.java