handle null query returning from query parsers properly
now that we support "null" queries, for example, when parsing a query and its lenient, make sure to handle it where applicable
This commit is contained in:
parent
e43dd4687e
commit
a1ab48c804
|
@ -166,6 +166,9 @@ public class FieldQueryParser implements QueryParser {
|
|||
|
||||
try {
|
||||
query = queryParser.parse(qpSettings.queryString());
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
query.setBoost(qpSettings.boost());
|
||||
query = optimizeQuery(fixNegativeQueryIfNeeded(query));
|
||||
if (query instanceof BooleanQuery) {
|
||||
|
|
|
@ -139,6 +139,9 @@ public class MatchQueryParser implements QueryParser {
|
|||
}
|
||||
|
||||
Query query = matchQuery.parse(type, fieldName, text);
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (query instanceof BooleanQuery) {
|
||||
Queries.applyMinimumShouldMatch((BooleanQuery) query, minimumShouldMatch);
|
||||
|
|
|
@ -169,6 +169,9 @@ public class MultiMatchQueryParser implements QueryParser {
|
|||
}
|
||||
|
||||
Query query = multiMatchQuery.parse(type, fieldNames, text);
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (query instanceof BooleanQuery) {
|
||||
Queries.applyMinimumShouldMatch((BooleanQuery) query, minimumShouldMatch);
|
||||
|
|
|
@ -210,6 +210,9 @@ public class QueryStringQueryParser implements QueryParser {
|
|||
|
||||
try {
|
||||
query = queryParser.parse(qpSettings.queryString());
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
query.setBoost(qpSettings.boost());
|
||||
query = optimizeQuery(fixNegativeQueryIfNeeded(query));
|
||||
if (query instanceof BooleanQuery) {
|
||||
|
|
Loading…
Reference in New Issue