FacetRequest.getValueOf is responsible for resolving an ordinal's value. It is given FacetArrays, and typically does something like arrays.getIntArray()[ord] – for every ordinal! The purpose of this method is to allow special requests, e.g. average, to do some post processing on the values, that couldn't be done during aggregation.
I feel that getValueOf is in the wrong place – the calls to getInt/FloatArray are really redundant. Also, if an aggregator maintains some statistics by which it needs to "correct" the aggregated values, it's not trivial to pass it from the aggregator to the request.
Therefore I would like to make the following changes:
- Remove FacetRequest.getValueOf and .getFacetArraysSource
- Add FacetsAggregator.createOrdinalValueResolver which takes the FacetArrays and has a simple API .valueOf(ordinal).
- Modify the FacetResultHandlers to use OrdValResolver.
This allows an OVR to initialize the right array instance(s) in the ctor, and return the value of the requested ordinal, without doing arrays.getArray() calls.
Will post a patch shortly.
|Transition||Time In Source Status||Execution Times||Last Executer||Last Execution Date|
|13h 25m||1||Shai Erera||01/Aug/13 10:05|
|65d 14m||1||Adrien Grand||05/Oct/13 10:19|
|Status||Resolved [ 5 ]||Closed [ 6 ]|
|Resolution||Fixed [ 1 ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Fix Version/s||5.0 [ 12321663 ]|
|Fix Version/s||4.5 [ 12324742 ]|