mkhludnev commented on code in PR #2025:
URL: https://github.com/apache/solr/pull/2025#discussion_r1385654200
##########
solr/core/src/java/org/apache/solr/search/join/FiltersQParser.java:
##########
@@ -61,6 +61,9 @@ protected BooleanQuery parseImpl() throws SyntaxError {
for (Map.Entry<QParser, Occur> clause : clauses.entrySet()) {
builder.add(unwrapQuery(clause.getKey().getQuery(), clause.getValue()),
clause.getValue());
}
+
+ builder.setMinimumNumberShouldMatch(minShouldMatch());
Review Comment:
> Could it be because FILTER clauses are considered required, and never
optional?
indeed [Like
MUST](https://lucene.apache.org/core/9_4_1/core/org/apache/lucene/search/BooleanClause.Occur.html#FILTER)
>
> Also, if one needs to use, say, three clauses in the filter query and make
sure that at least two match, - it should be possible to construct such filter
query as `{!bool filter=...}`, where the only FILTER clause is itself a boolean
query with three SHOULD clauses and mm=2.
perhaps,
1. wrap a such of bool of should via single clause filter.
2. wipe the score of that `{!bool should=... mm=2}^=0`
3. or wipe scores of underneath filters via `{!bool should=A:b^=0
should=C:d^=0 should=E:f^=0 mm=2}`
NB: I'm not sure whether parser is capable to parse those options above. If
it isn't, one can trick it with local param referencing.
--
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]