Details

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

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: