Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
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.