org.apache.lucene.search.grouping.dv
Class DVGroupFacetCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.apache.lucene.search.grouping.AbstractGroupFacetCollector
          extended by org.apache.lucene.search.grouping.dv.DVGroupFacetCollector

public abstract class DVGroupFacetCollector
extends AbstractGroupFacetCollector

An implementation of AbstractGroupFacetCollector that computes grouped facets based on docvalues.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.AbstractGroupFacetCollector
AbstractGroupFacetCollector.FacetEntry, AbstractGroupFacetCollector.GroupedFacetResult, AbstractGroupFacetCollector.SegmentResult
 
Field Summary
 
Fields inherited from class org.apache.lucene.search.grouping.AbstractGroupFacetCollector
endFacetOrd, facetField, facetPrefix, groupField, segmentFacetCounts, segmentResults, segmentTotalCount, startFacetOrd
 
Method Summary
static DVGroupFacetCollector createDvGroupFacetCollector(String groupField, DocValues.Type groupDvType, boolean groupDiskResident, String facetField, DocValues.Type facetDvType, boolean facetDiskResident, BytesRef facetPrefix, int initialSize)
          Factory method for creating the right implementation based on the group docvalues type and the facet docvalues type.
 
Methods inherited from class org.apache.lucene.search.grouping.AbstractGroupFacetCollector
acceptsDocsOutOfOrder, createSegmentResult, mergeSegmentResults, setScorer
 
Methods inherited from class org.apache.lucene.search.Collector
collect, setNextReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDvGroupFacetCollector

public static DVGroupFacetCollector createDvGroupFacetCollector(String groupField,
                                                                DocValues.Type groupDvType,
                                                                boolean groupDiskResident,
                                                                String facetField,
                                                                DocValues.Type facetDvType,
                                                                boolean facetDiskResident,
                                                                BytesRef facetPrefix,
                                                                int initialSize)
Factory method for creating the right implementation based on the group docvalues type and the facet docvalues type. Currently only the DocValues.Type.BYTES_VAR_SORTED and the DocValues.Type.BYTES_FIXED_SORTED are the only docvalues type supported for both the group and facet field.

Parameters:
groupField - The group field
groupDvType - The docvalues type for the group field
groupDiskResident - Whether the group docvalues should be disk resident
facetField - The facet field
facetDvType - The docvalues type for the facet field
facetDiskResident - Whether the facet docvalues should be disk resident
facetPrefix - The facet prefix a facet entry should start with to be included.
initialSize - The initial allocation size of the internal int set and group facet list which should roughly match the total number of expected unique groups. Be aware that the heap usage is 4 bytes * initialSize.
Returns:
a DVGroupFacetCollector implementation


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.