Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4, Trunk
    • Component/s: query parsers
    • Labels:
      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))

      1. SOLR-4785-boostfix.patch
        3 kB
        Jan Høydahl
      2. SOLR-4785-Add-tests-for-maxscore-to-QueryEqualityTest.patch
        2 kB
        Greg Bowyer
      3. SOLR-4785.patch
        11 kB
        Jan Høydahl
      4. SOLR-4785.patch
        11 kB
        Jan Høydahl

        Activity

        Jan Høydahl created issue -
        Jan Høydahl made changes -
        Field Original Value New Value
        Attachment SOLR-4785.patch [ 12581870 ]
        Jan Høydahl made changes -
        Attachment SOLR-4785.patch [ 12581874 ]
        Jan Høydahl made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mark Miller made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Greg Bowyer made changes -
        Jan Høydahl made changes -
        Attachment SOLR-4785-boostfix.patch [ 12585016 ]
        Jan Høydahl made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Steve Rowe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jan Høydahl
            Reporter:
            Jan Høydahl
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development