Class LongAggregationsFacetRecorder
java.lang.Object
org.apache.lucene.sandbox.facet.recorders.LongAggregationsFacetRecorder
- All Implemented Interfaces:
- FacetRecorder
FacetRecorder that computes multiple long aggregations per facet.
 TODO: [premature optimization idea] if instead of one array we keep aggregations in two LongVector (one for MAX aggregation and one for SUM) we can benefit from SIMD?
- WARNING: This API is experimental and might change in incompatible ways in the next release.
- 
Constructor SummaryConstructorsConstructorDescriptionLongAggregationsFacetRecorder(LongValuesSource[] longValuesSources, Reducer[] reducers) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontains(int ordinal) Check if any data was recorded for provided facet ordinal.getLeafRecorder(LeafReaderContext context) Get leaf recorder.longgetRecordedValue(int ord, int valuesId) Return aggregated value for facet ordinal and aggregation ID, or zero as default.booleanisEmpty()True if there are no recordsReturn next collected ordinal, orOrdinalIterator.NO_MORE_ORDSvoidreduce(FacetCutter facetCutter) Reduce leaf recorder results into this recorder.
- 
Constructor Details- 
LongAggregationsFacetRecorderConstructor.
 
- 
- 
Method Details- 
getLeafRecorderDescription copied from interface:FacetRecorderGet leaf recorder.- Specified by:
- getLeafRecorderin interface- FacetRecorder
- Throws:
- IOException
 
- 
recordedOrdsDescription copied from interface:FacetRecorderReturn next collected ordinal, orOrdinalIterator.NO_MORE_ORDS- Specified by:
- recordedOrdsin interface- FacetRecorder
 
- 
isEmptypublic boolean isEmpty()Description copied from interface:FacetRecorderTrue if there are no records- Specified by:
- isEmptyin interface- FacetRecorder
 
- 
reduceDescription copied from interface:FacetRecorderReduce leaf recorder results into this recorder. IfFacetCutter.getOrdinalsToRollup()result is not null, it also rolls up values.After this method is called, it's illegal to add values to recorder, i.e. calling FacetRecorder.getLeafRecorder(org.apache.lucene.index.LeafReaderContext)orLeafFacetRecorder.record(int, int)on its leaf recorders.- Specified by:
- reducein interface- FacetRecorder
- Throws:
- IOException
 
- 
containspublic boolean contains(int ordinal) Description copied from interface:FacetRecorderCheck if any data was recorded for provided facet ordinal.- Specified by:
- containsin interface- FacetRecorder
 
- 
getRecordedValuepublic long getRecordedValue(int ord, int valuesId) Return aggregated value for facet ordinal and aggregation ID, or zero as default.
 
-