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

'collapse' on numeric field treats all docs with '0' in collapse field as part of the null group

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 8.8, 9.0
    • None
    • None

    Description

      The CollapseQParser has some very, very, old code/semantics in it that date back to when the FieldCache was incapable of differentiating between a document that contained '0' in the field being un-inverted, and a document that didn't have any value in that field.

      This limitation does not exist in DocValues (nor has it existed for a long time) but as the DocValues API has evolved, and as the collapse code has been updated to take advantage of the newer APIs that make it obvious when a document has no value in a field, the collapse code still explicitly equates "0" in a numeric field with the "null group"

      We can/should fix this bug so that the behavior is sane.


      Known workaround for this problem: (redundantly) index a "string" version of the field being collapsed on - but this is a poor substitute fro being able to efficiently collapse on numeric fields (which take up less space on disk and in the collapse data structures)

      Attachments

        1. SOLR-15047.patch
          33 kB
          Chris M. Hostetter
        2. SOLR-15047.patch
          31 kB
          Chris M. Hostetter
        3. SOLR-15047.patch
          3 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: