Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7829

Pivot Facet Bug: facet.missing=true + facet.sort=index facet.pivot.mincount > ? == incorrect "missing" count

    Details

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

      Description

      Following up on SOLR-7804 lead to this error which i'm splitting off into it's own issue. the nuthsell is that if you combine facet.missing, facet.pivot.mincount, and facet.sort=index you might get incorrect counts (or no counts at all) for the missing value of a pivot.

      fairly easy to reproduce the most extreme aspect of the problem (not getting a missing count back even though it's above the minumum)...

      bin/solr -e cloud -noprompt
      bin/post -c gettingstarted example/exampledocs/*.xml
      
      http://localhost:8983/solr/gettingstarted/query?rows=0&q=*:*&facet=true&facet.pivot=inStock&facet.missing=true
      ...
          "facet_pivot":{
            "inStock":[{
                "field":"inStock",
                "value":true,
                "count":17},
              {
                "field":"inStock",
                "value":false,
                "count":4},
              {
                "field":"inStock",
                "value":null,
                "count":11}]}}}
      
      http://localhost:8983/solr/gettingstarted/query?rows=0&q=*:*&facet=true&facet.pivot=inStock&facet.missing=true&facet.pivot.mincount=10
      ...
          "facet_pivot":{
            "inStock":[{
                "field":"inStock",
                "value":true,
                "count":17},
              {
                "field":"inStock",
                "value":null,
                "count":11}]}}}
      
      http://localhost:8983/solr/gettingstarted/query?rows=0&q=*:*&facet=true&facet.pivot=inStock&facet.missing=true&facet.pivot.mincount=10&facet.sort=index
      ...
          "facet_pivot":{
            "inStock":[{
                "field":"inStock",
                "value":true,
                "count":17}]}}}
      
      

      ...note that in the last example, the 'null' count is gone (even though it's above the minimum) just because we changed the facet.sort.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hossman Hoss Man
                Reporter:
                hossman Hoss Man
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: