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

Improve robustness of ExpandComponent

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.4
    • Labels:
      None

      Description

      The ExpandComponent causes a NullPointerException if accidentally used without prior collapsing of results.

      If there are multiple documents in the result which have the same term value in the expand field, the size of the ordBytes/groupSet differs from the count value, and the getGroupQuery method creates an incompletely filled bytesRef array, which later causes a NullPointerException when trying to sort the terms.

      The attached patch extends the test to demonstrate the error, and modifies the getGroupQuery methods to create the array based on the size of the input maps.

        Attachments

        1. expand-component.patch
          3 kB
          Jörg Rathlev
        2. expand-npe.patch
          2 kB
          Michael Gibney
        3. SOLR-7798.patch
          6 kB
          Munendra S N

          Activity

            People

            • Assignee:
              munendrasn Munendra S N
              Reporter:
              joergr Jörg Rathlev
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m