Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
A customer wants to contribute back this component.
It is a QParser which behaves exactly like "lucene" parser (extends it), but returns the Max score from the clauses, i.e. max(c1,c2,c3..) instead of the default which is sum(c1,c2,c3...). It does this by wrapping all SHOULD clauses in a DisjunctionMaxQuery with tie=1.0. Any MUST or PROHIBITED clauses are passed through as-is. Non-boolean queries, e.g. NumericRange falls-through to "lucene" parser.
To use, add to solrconfig.xml:
<queryParser name="maxscore" class="solr.MaxScoreQParserPlugin"/>
Then use it in a query
q=A AND B AND {!maxscore v=$max}&max=C OR (D AND E)
This will return the score of A+B+max(C,sum(D+E))