dsmiley commented on code in PR #4475:
URL: https://github.com/apache/solr/pull/4475#discussion_r3328783280
##########
solr/core/src/java/org/apache/solr/search/join/FiltersQParser.java:
##########
@@ -59,7 +59,14 @@ protected BooleanQuery parseImpl() throws SyntaxError {
BooleanQuery.Builder builder = createBuilder();
for (Map.Entry<QParser, Occur> clause : clauses.entrySet()) {
- builder.add(unwrapQuery(clause.getKey().getQuery(), clause.getValue()),
clause.getValue());
+
+ Query query = clause.getKey().getQuery();
+ Occur occur = clause.getValue();
+
+ if (occur == Occur.SHOULD && query instanceof BooleanQuery boolQ &&
boolQ.clauses().isEmpty()) {
Review Comment:
this string of conditions looks very hacky. Reading the description... I
thought there was going to be a null somewhere to check for?
##########
solr/core/src/test/org/apache/solr/search/TestMmBoolQParserPlugin.java:
##########
@@ -109,6 +109,17 @@ public void testMinShouldMatchThresholdsLower() throws
Exception {
assertEquals(expected, actual);
}
+ @Test
+ public void testMinShouldMatchWithEmptyClauseCausedByStopWord() throws
Exception {
Review Comment:
test fails: `undefined field name_sw`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]