org.apache.lucene.facet.sortedset
Class SortedSetDocValuesReaderState

java.lang.Object
  extended by org.apache.lucene.facet.sortedset.SortedSetDocValuesReaderState
Direct Known Subclasses:
DefaultSortedSetDocValuesReaderState

public abstract class SortedSetDocValuesReaderState
extends Object

Wraps a IndexReader and resolves ords using existing SortedSetDocValues APIs without a separate taxonomy index. This only supports flat facets (dimension + label), and it makes faceting a bit slower, adds some cost at reopen time, but avoids managing the separate taxonomy index. It also requires less RAM than the taxonomy index, as it manages the flat (2-level) hierarchy more efficiently. In addition, the tie-break during faceting is now meaningful (in label sorted order).

NOTE: creating an instance of this class is somewhat costly, as it computes per-segment ordinal maps, so you should create it once and re-use that one instance for a given IndexReader.


Nested Class Summary
static class SortedSetDocValuesReaderState.OrdRange
          Holds start/end range of ords, which maps to one dimension (someday we may generalize it to map to hierarchies within one dimension).
 
Constructor Summary
protected SortedSetDocValuesReaderState()
          Sole constructor.
 
Method Summary
abstract  SortedSetDocValues getDocValues()
          Return top-level doc values.
abstract  String getField()
          Indexed field we are reading.
abstract  SortedSetDocValuesReaderState.OrdRange getOrdRange(String dim)
          Returns the SortedSetDocValuesReaderState.OrdRange for this dimension.
abstract  IndexReader getOrigReader()
          Returns top-level index reader.
abstract  Map<String,SortedSetDocValuesReaderState.OrdRange> getPrefixToOrdRange()
          Returns mapping from prefix to SortedSetDocValuesReaderState.OrdRange.
abstract  int getSize()
          Number of unique labels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedSetDocValuesReaderState

protected SortedSetDocValuesReaderState()
Sole constructor.

Method Detail

getDocValues

public abstract SortedSetDocValues getDocValues()
                                         throws IOException
Return top-level doc values.

Throws:
IOException

getField

public abstract String getField()
Indexed field we are reading.


getOrdRange

public abstract SortedSetDocValuesReaderState.OrdRange getOrdRange(String dim)
Returns the SortedSetDocValuesReaderState.OrdRange for this dimension.


getPrefixToOrdRange

public abstract Map<String,SortedSetDocValuesReaderState.OrdRange> getPrefixToOrdRange()
Returns mapping from prefix to SortedSetDocValuesReaderState.OrdRange.


getOrigReader

public abstract IndexReader getOrigReader()
Returns top-level index reader.


getSize

public abstract int getSize()
Number of unique labels.



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