org.apache.lucene.facet.enhancements
Class EnhancementsPayloadIterator

java.lang.Object
  extended by org.apache.lucene.facet.search.PayloadIterator
      extended by org.apache.lucene.facet.enhancements.EnhancementsPayloadIterator

public class EnhancementsPayloadIterator
extends PayloadIterator

A PayloadIterator for iterating over category posting lists generated using EnhancementsCategoryTokenizer.

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

Field Summary
 
Fields inherited from class org.apache.lucene.facet.search.PayloadIterator
buffer, payloadLength
 
Constructor Summary
EnhancementsPayloadIterator(List<CategoryEnhancement> enhancementsList, IndexReader indexReader, Term term)
          Constructor.
 
Method Summary
 Object getCategoryData(CategoryEnhancement enhancedCategory)
          Get the data of the current category and document for a certain enhancement, or null if no such enhancement exists.
 boolean setdoc(int docId)
          Skip forward to document docId.
 
Methods inherited from class org.apache.lucene.facet.search.PayloadIterator
getBuffer, getPayloadLength, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnhancementsPayloadIterator

public EnhancementsPayloadIterator(List<CategoryEnhancement> enhancementsList,
                                   IndexReader indexReader,
                                   Term term)
                            throws IOException
Constructor.

Parameters:
enhancementsList - A list of the CategoryEnhancements from the indexing params.
indexReader - A reader of the index.
term - The category term to iterate.
Throws:
IOException
Method Detail

setdoc

public boolean setdoc(int docId)
               throws IOException
Description copied from class: PayloadIterator
Skip forward to document docId. Return true if this document exists and has any payload.

Users should call this method with increasing docIds, and implementations can assume that this is the case.

Overrides:
setdoc in class PayloadIterator
Throws:
IOException

getCategoryData

public Object getCategoryData(CategoryEnhancement enhancedCategory)
Get the data of the current category and document for a certain enhancement, or null if no such enhancement exists.

Parameters:
enhancedCategory - The category enhancement to apply.
Returns:
the data of the current category and document for a certain enhancement, or null if no such enhancement exists.