Solr
  1. Solr
  2. SOLR-7412

range.facet.other produces incorrect counts in distributed search

    Details

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

      Description

      Reported by Will Miller in the users list:

      This first query is against node1 with distrib=false:

      http://localhost:8983/solr/gettingstarted/select/?q=*:*&wt=json&indent=true&distrib=false&facet=true&facet.range=price&f.price.facet.range.start=0.00&f.price.facet.range.end=100.00&f.price.facet.range.gap=20&f.price.facet.range.other=all&defType=edismax&q.op=AND

      There are 7 Results (results ommited).
      "facet_ranges":{
      "price":{
      "counts":[
      "0.0",1,
      "20.0",0,
      "40.0",0,
      "60.0",0,
      "80.0",1],
      "gap":20.0,
      "start":0.0,
      "end":100.0,
      "before":0,
      "after":5,
      "between":2}},

      This second query is against node2 with distrib=false:
      http://localhost:7574/solr/gettingstarted/select/?q=*:*&wt=json&indent=true&distrib=false&facet=true&facet.range=price&f.price.facet.range.start=0.00&f.price.facet.range.end=100.00&f.price.facet.range.gap=20&f.price.facet.range.other=all&defType=edismax&q.op=AND

      7 Results (one product does not have a price):
      "facet_ranges":{
      "price":{
      "counts":[
      "0.0",1,
      "20.0",0,
      "40.0",0,
      "60.0",1,
      "80.0",0],
      "gap":20.0,
      "start":0.0,
      "end":100.0,
      "before":0,
      "after":4,
      "between":2}},

      Finally querying the entire collection:
      http://localhost:7574/solr/gettingstarted/select/?q=*:*&wt=json&indent=true&facet=true&facet.range=price&f.price.facet.range.start=0.00&f.price.facet.range.end=100.00&f.price.facet.range.gap=20&f.price.facet.range.other=all&defType=edismax&q.op=AND

      14 results (one without a price range):
      "facet_ranges":{
      "price":{
      "counts":[
      "0.0",2,
      "20.0",0,
      "40.0",0,
      "60.0",1,
      "80.0",1],
      "gap":20.0,
      "start":0.0,
      "end":100.0,
      "before":0,
      "after":5,
      "between":2}},

      Notice that both the "after" and the "between" are wrong here. The actual buckets do correctly represent the right values but I would expect "between" to be 5 and "after" to be 13.

      1. SOLR-7412.patch
        8 kB
        Tomás Fernández Löbbe
      2. SOLR-7412.patch
        4 kB
        Tomás Fernández Löbbe

        Issue Links

          Activity

          Hide
          Tomás Fernández Löbbe added a comment -

          Patch with a simple test and possible fix

          Show
          Tomás Fernández Löbbe added a comment - Patch with a simple test and possible fix
          Hide
          Tomás Fernández Löbbe added a comment -

          Improved the test a bit. Assert the returned values.

          Show
          Tomás Fernández Löbbe added a comment - Improved the test a bit. Assert the returned values.
          Hide
          ASF subversion and git services added a comment -

          Commit 1674182 from Tomás Fernández Löbbe in branch 'dev/trunk'
          [ https://svn.apache.org/r1674182 ]

          SOLR-7412: Fixed range.facet.other parameter for distributed requests

          Show
          ASF subversion and git services added a comment - Commit 1674182 from Tomás Fernández Löbbe in branch 'dev/trunk' [ https://svn.apache.org/r1674182 ] SOLR-7412 : Fixed range.facet.other parameter for distributed requests
          Hide
          ASF subversion and git services added a comment -

          Commit 1674186 from Tomás Fernández Löbbe in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1674186 ]

          SOLR-7412: Fixed range.facet.other parameter for distributed requests

          Show
          ASF subversion and git services added a comment - Commit 1674186 from Tomás Fernández Löbbe in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1674186 ] SOLR-7412 : Fixed range.facet.other parameter for distributed requests
          Hide
          Tomás Fernández Löbbe added a comment -

          Thanks for reporting Will.

          Show
          Tomás Fernández Löbbe added a comment - Thanks for reporting Will.
          Hide
          Anshum Gupta added a comment -

          Bulk close for 5.2.0.

          Show
          Anshum Gupta added a comment - Bulk close for 5.2.0.

            People

            • Assignee:
              Tomás Fernández Löbbe
              Reporter:
              Tomás Fernández Löbbe
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development