lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl (JIRA) <>
Subject [jira] [Updated] (SOLR-4785) New MaxScoreQParserPlugin
Date Tue, 28 May 2013 10:30:22 GMT


Jan Høydahl updated SOLR-4785:

    Attachment: SOLR-4785-boostfix.patch

This additional patch fixes a bug with top-level BooleanQuery boost being lost. Also adds
some boost tests.

Will commit soon.
> New MaxScoreQParserPlugin
> -------------------------
>                 Key: SOLR-4785
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>          Components: query parsers
>            Reporter: Jan Høydahl
>            Assignee: Jan Høydahl
>            Priority: Minor
>             Fix For: 5.0, 4.4
>         Attachments: SOLR-4785-Add-tests-for-maxscore-to-QueryEqualityTest.patch, SOLR-4785-boostfix.patch,
SOLR-4785.patch, SOLR-4785.patch
> 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:
> {code:xml}
>   <queryParser name="maxscore" class="solr.MaxScoreQParserPlugin"/>
> {code}
> Then use it in a query
> {noformat}
> q=A AND B AND {!maxscore v=$max}&max=C OR (D AND E)
> {noformat}
> This will return the score of A+B+max(C,sum(D+E))

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message