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.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

        Hide
        Steve Rowe added a comment -

        Bulk close resolved 4.4 issues

        Show
        Steve Rowe added a comment - Bulk close resolved 4.4 issues
        Hide
        Jan Høydahl added a comment -

        Committed fix to trunk (1486898) and 4x (1486901)

        Show
        Jan Høydahl added a comment - Committed fix to trunk (1486898) and 4x (1486901)
        Hide
        Jan Høydahl added a comment -

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

        Will commit soon.

        Show
        Jan Høydahl added a comment - This additional patch fixes a bug with top-level BooleanQuery boost being lost. Also adds some boost tests. Will commit soon.
        Hide
        Jan Høydahl added a comment -

        Thanks for tackling this Greg and Robert. I'm sure I ran the full tests before commit but must have messed it up somewhere along the way.

        Show
        Jan Høydahl added a comment - Thanks for tackling this Greg and Robert. I'm sure I ran the full tests before commit but must have messed it up somewhere along the way.
        Hide
        Robert Muir added a comment -

        I will commit this for now. Too many tests are failing in solr (test suite never passes).

        Show
        Robert Muir added a comment - I will commit this for now. Too many tests are failing in solr (test suite never passes).
        Hide
        Robert Muir added a comment -

        I had a stab at putting some basic equality tests in place, but looking at the test case itself I wonder if QueryEqualityTest should be re-worked with the full fury of randomised testing, as it seems to be at best, only testing the happy cases.

        Can you commit this? I think its more important that the build is unbroken.

        Show
        Robert Muir added a comment - I had a stab at putting some basic equality tests in place, but looking at the test case itself I wonder if QueryEqualityTest should be re-worked with the full fury of randomised testing, as it seems to be at best, only testing the happy cases. Can you commit this? I think its more important that the build is unbroken.
        Hide
        Greg Bowyer added a comment -

        This bit me while I was updating my filter patch (SOLR-3763)

        I had a stab at putting some basic equality tests in place, but looking at the test case itself I wonder if QueryEqualityTest should be re-worked with the full fury of randomised testing, as it seems to be at best, only testing the happy cases.

        Show
        Greg Bowyer added a comment - This bit me while I was updating my filter patch ( SOLR-3763 ) I had a stab at putting some basic equality tests in place, but looking at the test case itself I wonder if QueryEqualityTest should be re-worked with the full fury of randomised testing, as it seems to be at best, only testing the happy cases.
        Hide
        Mark Miller added a comment -

        This one seems to be causing a test fail.

        Show
        Mark Miller added a comment - This one seems to be causing a test fail.
        Hide
        Jan Høydahl added a comment -

        Also added the new parser to the list in http://wiki.apache.org/solr/QueryParser

        Show
        Jan Høydahl added a comment - Also added the new parser to the list in http://wiki.apache.org/solr/QueryParser
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] janhoy
        http://svn.apache.org/viewvc?view=revision&revision=1481656

        SOLR-4785: New MaxScoreQParserPlugin (merge from trunk)

        Show
        Commit Tag Bot added a comment - [branch_4x commit] janhoy http://svn.apache.org/viewvc?view=revision&revision=1481656 SOLR-4785 : New MaxScoreQParserPlugin (merge from trunk)
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] janhoy
        http://svn.apache.org/viewvc?view=revision&revision=1481651

        SOLR-4785: New MaxScoreQParserPlugin

        Show
        Commit Tag Bot added a comment - [trunk commit] janhoy http://svn.apache.org/viewvc?view=revision&revision=1481651 SOLR-4785 : New MaxScoreQParserPlugin
        Hide
        Jan Høydahl added a comment -

        Small javadoc fix to pass precommit

        This should be ready for committing, will wait a few days for any comments from community

        Show
        Jan Høydahl added a comment - Small javadoc fix to pass precommit This should be ready for committing, will wait a few days for any comments from community
        Hide
        Jan Høydahl added a comment -

        First patch with tests and support for "tie" parameter

        Show
        Jan Høydahl added a comment - First patch with tests and support for "tie" parameter

          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