Details
Description
In the case needsScores=false, createWeight calls rewriteNoScoring before creating a new BooleanWeight. This in all cases creates a new BooleanQuery, even when it's not necessary (aka there are no MUST clauses).
The rewriteNoScoring method could check for something as simple as if (clauseSets.get(Occur.MUST).size() > 0) before creating a brand new BooleanQuery.