Class Lucene103BlockTreeTermsReader
java.lang.Object
org.apache.lucene.index.Fields
org.apache.lucene.codecs.FieldsProducer
org.apache.lucene.codecs.lucene103.blocktree.Lucene103BlockTreeTermsReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<String>
A block-based terms index and dictionary that assigns terms to variable length blocks according
to how they share prefixes. The terms index is a prefix trie whose leaves are term blocks. The
advantage of this approach is that seekExact is often able to determine a term cannot exist
without doing any IO, and intersection with Automata is very fast. Note that this terms
dictionary has its own fixed terms index (ie, it does not support a pluggable terms index
implementation).
NOTE: this terms dictionary supports min/maxItemsPerBlock during indexing to control how much memory the terms index uses.
The data structure used by this implementation is very similar to a burst trie (http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.18.3499), but with added logic to break up too-large blocks of all terms sharing a given prefix into smaller ones.
Use CheckIndex with the -verbose option to see
summary statistics on the blocks in the dictionary.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCurrent terms format.static final intInitial terms format.Fields inherited from class org.apache.lucene.index.Fields
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionLucene103BlockTreeTermsReader(PostingsReaderBase postingsReader, SegmentReadState state) Sole constructor. -
Method Summary
Methods inherited from class org.apache.lucene.codecs.FieldsProducer
getMergeInstanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
VERSION_START
public static final int VERSION_STARTInitial terms format.- See Also:
-
VERSION_CURRENT
public static final int VERSION_CURRENTCurrent terms format.- See Also:
-
-
Constructor Details
-
Lucene103BlockTreeTermsReader
public Lucene103BlockTreeTermsReader(PostingsReaderBase postingsReader, SegmentReadState state) throws IOException Sole constructor.- Throws:
IOException
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFieldsProducer- Throws:
IOException
-
iterator
Description copied from class:FieldsReturns an iterator that will step through all fields names. This will not return null. -
terms
Description copied from class:FieldsGet theTermsfor this field. This will return null if the field does not exist.- Specified by:
termsin classFields- Throws:
IOException
-
size
public int size()Description copied from class:FieldsReturns the number of fields or -1 if the number of distinct field names is unknown. If >= 0,Fields.iterator()will return as many field names. -
checkIntegrity
Description copied from class:FieldsProducerChecks consistency of this reader.Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.
- Specified by:
checkIntegrityin classFieldsProducer- Throws:
IOException
-
toString
-