Solr
  1. Solr
  2. SOLR-3936

QueryElevationComponent: Wrong order when result grouping is activated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.5, 6.0
    • Labels:
      None

      Description

      When I use elevation together with grouping I got not the expected result order.

      I tried it with the standard solr example:

      http://localhost:8983/solr/elevate?enableElevation=true&fl=score%2C[elevated]%2Cid%2Cname&forceElevation=true&group.field=manu&group=on&indent=on&q=ipod&wt=json

      but the results ignored the elevation:

      {
      "responseHeader":{
      "status":0,
      "QTime":2,
      "params":{
      "enableElevation":"true",
      "fl":"score,[elevated],id,name",
      "indent":"on",
      "q":"ipod",
      "forceElevation":"true",
      "group.field":"manu",
      "group":"on",
      "wt":"json"}},
      "grouped":{
      "manu":{
      "matches":2,
      "groups":[{
      "groupValue":"belkin",
      "doclist":{"numFound":1,"start":0,"maxScore":0.7698604,"docs":[

      { "id":"F8V7067-APL-KIT", "name":"Belkin Mobile Power Cord for iPod w/ Dock", "score":0.7698604, "[elevated]":false}

      ]
      }},
      {
      "groupValue":"inc",
      "doclist":{"numFound":1,"start":0,"maxScore":0.28869766,"docs":[

      { "id":"MA147LL/A", "name":"Apple 60 GB iPod with Video Playback Black", "score":0.28869766, "[elevated]":true}

      ]
      }}]}}}

      the elevate.xml defines the following rules :

      <query text="ipod">
      <doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
      <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
      </query>

      </elevate>

      1. SOLR-3936.patch
        14 kB
        Hoss Man
      2. SOLR-3936.patch
        7 kB
        Michael Garski

        Activity

        Hide
        Michael Berger added a comment -

        I tried to fix by myself:

        "debug":{
        "queryBoosting":

        { "q":"ipod", "match":["MA147LL/A"]}

        ,
        "rawquerystring":"ipod",
        "querystring":"ipod",
        "parsedquery":"(text:ipod ((id:MA147LL/A)^10.0) -id:IW-02)/no_coord",
        "parsedquery_toString":"text:ipod ((id:MA147LL/A)^0.0) -id:IW-02",

        I found that the boost factor is too low.

        I set a higher boost factor for booster.include in QueryElevationComponent.java and I get the expected result from my query.

        Show
        Michael Berger added a comment - I tried to fix by myself: "debug":{ "queryBoosting": { "q":"ipod", "match":["MA147LL/A"]} , "rawquerystring":"ipod", "querystring":"ipod", "parsedquery":"(text:ipod ((id:MA147LL/A)^10.0) -id:IW-02)/no_coord", "parsedquery_toString":"text:ipod ((id:MA147LL/A)^0.0) -id:IW-02", I found that the boost factor is too low. I set a higher boost factor for booster.include in QueryElevationComponent.java and I get the expected result from my query.
        Hide
        Michael Garski added a comment -

        The root issue is that the sorting for grouped queries comes from the GroupingSpecification, which is not modified by the QueryElevationComponent. Attached is a patch that adds support for using query elevations with grouped queries and a corresponding unit test.

        Show
        Michael Garski added a comment - The root issue is that the sorting for grouped queries comes from the GroupingSpecification, which is not modified by the QueryElevationComponent. Attached is a patch that adds support for using query elevations with grouped queries and a corresponding unit test.
        Hide
        Hoss Man added a comment -

        Michael Garski: Thanks for tracking this down and providing a patch, and esspecially thanks for including tests!

        Everything you have looks great – i've just updated your patch to include additional permutations (forceElevate, group.sort, etc...)

        I'll try to commit this tomorrow (running it through full regression now to make sure it doesn't break any other tests unexpectedly)

        Show
        Hoss Man added a comment - Michael Garski : Thanks for tracking this down and providing a patch, and esspecially thanks for including tests! Everything you have looks great – i've just updated your patch to include additional permutations (forceElevate, group.sort, etc...) I'll try to commit this tomorrow (running it through full regression now to make sure it doesn't break any other tests unexpectedly)
        Hide
        Michael Garski added a comment -

        Great! Thanks Hoss Man!

        Show
        Michael Garski added a comment - Great! Thanks Hoss Man !
        Hide
        ASF subversion and git services added a comment -

        Commit 1514795 from hossman@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1514795 ]

        SOLR-3936: Fixed QueryElevationComponent sorting when used with Grouping

        Show
        ASF subversion and git services added a comment - Commit 1514795 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1514795 ] SOLR-3936 : Fixed QueryElevationComponent sorting when used with Grouping
        Hide
        ASF subversion and git services added a comment -

        Commit 1514836 from hossman@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1514836 ]

        SOLR-3936: Fixed QueryElevationComponent sorting when used with Grouping (merge r1514795)

        Show
        ASF subversion and git services added a comment - Commit 1514836 from hossman@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1514836 ] SOLR-3936 : Fixed QueryElevationComponent sorting when used with Grouping (merge r1514795)
        Hide
        Hoss Man added a comment -

        Thanks again Michael!

        Show
        Hoss Man added a comment - Thanks again Michael!
        Hide
        Adrien Grand added a comment -

        4.5 release -> bulk close

        Show
        Adrien Grand added a comment - 4.5 release -> bulk close

          People

          • Assignee:
            Hoss Man
            Reporter:
            Michael Berger
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development