Class Lucene40BlockTreeTermsReader
- java.lang.Object
-
- org.apache.lucene.index.Fields
-
- org.apache.lucene.codecs.FieldsProducer
-
- org.apache.lucene.backward_codecs.lucene40.blocktree.Lucene40BlockTreeTermsReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<String>
public final class Lucene40BlockTreeTermsReader extends FieldsProducer
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
CheckIndexwith the-verboseoption to see summary statistics on the blocks in the dictionary.See
BlockTreeTermsWriter.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description static intVERSION_COMPRESSED_SUFFIXESSuffixes are compressed to save space.static intVERSION_CURRENTCurrent terms format.static intVERSION_META_FILEMetadata is written to its own file.static intVERSION_META_LONGS_REMOVEDThe long[] + byte[] metadata has been replaced with a single byte[].static intVERSION_STARTInitial terms format.-
Fields inherited from class org.apache.lucene.index.Fields
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description Lucene40BlockTreeTermsReader(PostingsReaderBase postingsReader, SegmentReadState state)Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIntegrity()voidclose()Iterator<String>iterator()intsize()Termsterms(String field)StringtoString()-
Methods inherited from class org.apache.lucene.codecs.FieldsProducer
getMergeInstance
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
VERSION_START
public static final int VERSION_START
Initial terms format.- See Also:
- Constant Field Values
-
VERSION_META_LONGS_REMOVED
public static final int VERSION_META_LONGS_REMOVED
The long[] + byte[] metadata has been replaced with a single byte[].- See Also:
- Constant Field Values
-
VERSION_COMPRESSED_SUFFIXES
public static final int VERSION_COMPRESSED_SUFFIXES
Suffixes are compressed to save space.- See Also:
- Constant Field Values
-
VERSION_META_FILE
public static final int VERSION_META_FILE
Metadata is written to its own file.- See Also:
- Constant Field Values
-
VERSION_CURRENT
public static final int VERSION_CURRENT
Current terms format.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Lucene40BlockTreeTermsReader
public Lucene40BlockTreeTermsReader(PostingsReaderBase postingsReader, SegmentReadState state) throws IOException
Sole constructor.- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFieldsProducer- Throws:
IOException
-
terms
public Terms terms(String field) throws IOException
- Specified by:
termsin classFields- Throws:
IOException
-
checkIntegrity
public void checkIntegrity() throws IOException- Specified by:
checkIntegrityin classFieldsProducer- Throws:
IOException
-
-