You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jan Høydahl (JIRA)" <ji...@apache.org> on 2013/05/03 15:24:15 UTC

[jira] [Created] (SOLR-4785) New MaxScoreQParserPlugin

Jan Høydahl created SOLR-4785:
---------------------------------

             Summary: New MaxScoreQParserPlugin
                 Key: SOLR-4785
                 URL: https://issues.apache.org/jira/browse/SOLR-4785
             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


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: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org