org.apache.lucene.facet.search.aggregator.associations
Class AssociationFloatSumAggregator

java.lang.Object
  extended by org.apache.lucene.facet.search.aggregator.associations.AssociationFloatSumAggregator
All Implemented Interfaces:
Aggregator

public class AssociationFloatSumAggregator
extends Object
implements Aggregator

An Aggregator which computes the weight of a category as the sum of the float values associated with it in the result documents.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Field Summary
protected  FloatAssociationsPayloadIterator associations
           
protected  String field
           
protected  float[] sumArray
           
 
Constructor Summary
AssociationFloatSumAggregator(float[] sumArray)
           
AssociationFloatSumAggregator(String field, float[] sumArray)
           
 
Method Summary
 void aggregate(int docID, float score, IntsRef ordinals)
          Aggregate the ordinals of the given document ID (and its score).
 boolean equals(Object obj)
           
 int hashCode()
           
 boolean setNextReader(AtomicReaderContext context)
          Sets the AtomicReaderContext for which Aggregator.aggregate(int, float, IntsRef) calls will be made.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

field

protected final String field

sumArray

protected final float[] sumArray

associations

protected final FloatAssociationsPayloadIterator associations
Constructor Detail

AssociationFloatSumAggregator

public AssociationFloatSumAggregator(float[] sumArray)
                              throws IOException
Throws:
IOException

AssociationFloatSumAggregator

public AssociationFloatSumAggregator(String field,
                                     float[] sumArray)
                              throws IOException
Throws:
IOException
Method Detail

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.