improve fixing negative query with adding the optimized match_all query

This commit is contained in:
kimchy 2010-10-22 14:50:48 +02:00
parent 5d1d927e09
commit 9a8e033424
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ public class Queries {
public static Query fixNegativeQueryIfNeeded(Query q) {
if (isNegativeQuery(q)) {
BooleanQuery newBq = (BooleanQuery) q.clone();
newBq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST);
newBq.add(MATCH_ALL_QUERY, BooleanClause.Occur.MUST);
return newBq;
}
return q;