The 4x implementation of the CollapsingQParserPlugin and the ExpandComponent are optimized to work with a top level FieldCache. Top level FieldCaches have a very fast docID to top-level ordinal lookup. Fast access to the top-level ordinals allows for very high performance field collapsing on high cardinality fields.
LUCENE-5666 unified the DocValues and FieldCache api's so that the top level FieldCache is no longer in regular use. Instead all top level caches are accessed through MultiDocValues.
This ticket does the following:
1) Optimizes Collapse and Expand to use MultiDocValues and makes this the default approach when collapsing on String fields
2) Provides an option to use a top level FieldCache if the performance of MultiDocValues is a blocker. The mechanism for switching to the FieldCache is a new "hint" parameter. If the hint parameter is set to "top_fc" then the top-level FieldCache would be used for both Collapse and Expand.
3) Adds numeric collapse field implementations.
4) Resolves issue