org.apache.lucene.facet.old
Class CountingAggregator
java.lang.Object
org.apache.lucene.facet.old.CountingAggregator
- All Implemented Interfaces:
- Aggregator
- Direct Known Subclasses:
- ComplementCountingAggregator
public class CountingAggregator
- extends Object
- implements Aggregator
An Aggregator
which updates a counter array with the size of the
whole taxonomy, counting the number of times each category appears in the
given set of documents.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
counterArray
protected int[] counterArray
CountingAggregator
public CountingAggregator(int[] counterArray)
aggregate
public void aggregate(int docID,
float score,
IntsRef ordinals)
throws IOException
- Description copied from interface:
Aggregator
- Aggregate the ordinals of the given document ID (and its score). The given
ordinals offset is always zero.
- Specified by:
aggregate
in interface Aggregator
- Throws:
IOException
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
setNextReader
public boolean setNextReader(AtomicReaderContext context)
throws IOException
- Description copied from interface:
Aggregator
- Sets the
AtomicReaderContext
for which
Aggregator.aggregate(int, float, IntsRef)
calls will be made. If this method
returns false, Aggregator.aggregate(int, float, IntsRef)
should not be called
for this reader.
- Specified by:
setNextReader
in interface Aggregator
- Throws:
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.