Solr
  1. Solr
  2. SOLR-4581

sort-order of facet-counts depends on facet.mincount

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2
    • Fix Version/s: 4.3, Trunk
    • Component/s: None
    • Labels:
      None

      Description

      I just upgraded to Solr 4.2 and cannot explain the following behaviour:

      I am using a solr.TrieDoubleField named 'ListPrice_EUR_INV' as a facet-field. The solr-response for the query

      'solr/Products/select?q=*%3A*&wt=xml&indent=true&facet=true&facet.field=ListPrice_EUR_INV&f.ListPrice_EUR_INV.facet.sort=index'

      includes the following facet-counts:

      <lst name="ListPrice_EUR_INV">
        <int name="-420.126">1</int>
        <int name="-285.672">1</int>
        <int name="-1.218">1</int>
      </lst>

      If I also set the parameter 'facet.mincount=1' in the query, the order of the facet-counts is reversed.

      <lst name="ListPrice_EUR_INV">
        <int name="-1.218">1</int>
        <int name="-285.672">1</int>
        <int name="-420.126">1</int>
      </lst>

      I would have expected, that the sort-order of the facet-counts is not affected by the facet.mincount parameter, as it is in Solr 4.1.
      Is this related to SOLR-2850?

      1. SOLR-4581.patch
        2 kB
        Shalin Shekhar Mangar
      2. SOLR-4581.patch
        2 kB
        Shalin Shekhar Mangar

        Issue Links

          Activity

          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.
          Hide
          Adrien Grand added a comment -

          Thanks for fixing the bug Yonik!

          Show
          Adrien Grand added a comment - Thanks for fixing the bug Yonik!
          Hide
          Yonik Seeley added a comment -

          committed.

          Show
          Yonik Seeley added a comment - committed.
          Hide
          Alexander Buhr added a comment -

          happy to hear this
          thx!

          Show
          Alexander Buhr added a comment - happy to hear this thx!
          Hide
          Yonik Seeley added a comment -

          OK, the code from SOLR-3855 had a bug where the IEEE float bits were used/compared directly for sort order, which is not correct for negative numbers.
          I'm testing a patch now, expect to commit shortly.

          Show
          Yonik Seeley added a comment - OK, the code from SOLR-3855 had a bug where the IEEE float bits were used/compared directly for sort order, which is not correct for negative numbers. I'm testing a patch now, expect to commit shortly.
          Hide
          Yonik Seeley added a comment -

          It looks like this is a new bug due to the new faceting code introduced in SOLR-3855

          Show
          Yonik Seeley added a comment - It looks like this is a new bug due to the new faceting code introduced in SOLR-3855
          Hide
          Shalin Shekhar Mangar added a comment -

          The bug is reproducible even after reverting SOLR-2850.

          Adding facet.method=fc gives correct response but omitting facet.method or using facet.method=enum gives the wrong sort order.

          I'm not that familiar with faceting code to fix this. Perhaps someone else can take a look.

          Show
          Shalin Shekhar Mangar added a comment - The bug is reproducible even after reverting SOLR-2850 . Adding facet.method=fc gives correct response but omitting facet.method or using facet.method=enum gives the wrong sort order. I'm not that familiar with faceting code to fix this. Perhaps someone else can take a look.
          Hide
          Shalin Shekhar Mangar added a comment -

          Test to demonstrate the issue.

          Show
          Shalin Shekhar Mangar added a comment - Test to demonstrate the issue.

            People

            • Assignee:
              Yonik Seeley
              Reporter:
              Alexander Buhr
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development