improve fixing negative query with adding the optimized match_all query
This commit is contained in:
parent
5d1d927e09
commit
9a8e033424
|
@ -82,7 +82,7 @@ public class Queries {
|
||||||
public static Query fixNegativeQueryIfNeeded(Query q) {
|
public static Query fixNegativeQueryIfNeeded(Query q) {
|
||||||
if (isNegativeQuery(q)) {
|
if (isNegativeQuery(q)) {
|
||||||
BooleanQuery newBq = (BooleanQuery) q.clone();
|
BooleanQuery newBq = (BooleanQuery) q.clone();
|
||||||
newBq.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST);
|
newBq.add(MATCH_ALL_QUERY, BooleanClause.Occur.MUST);
|
||||||
return newBq;
|
return newBq;
|
||||||
}
|
}
|
||||||
return q;
|
return q;
|
||||||
|
|
Loading…
Reference in New Issue