|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.index.Fields
org.apache.lucene.codecs.FieldsProducer
org.apache.lucene.codecs.BlockTreeTermsReader
public class BlockTreeTermsReader
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 it's own fixed terms index (ie, it does not support a pluggable terms index implementation).
NOTE: this terms dictionary does not support index divisor when opening an IndexReader. Instead, you can change the min/maxItemsPerBlock during indexing.
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.
See BlockTreeTermsWriter
.
Nested Class Summary | |
---|---|
class |
BlockTreeTermsReader.FieldReader
BlockTree's implementation of Terms . |
static class |
BlockTreeTermsReader.Stats
BlockTree statistics for a single field returned by BlockTreeTermsReader.FieldReader.computeStats() . |
Field Summary |
---|
Fields inherited from class org.apache.lucene.index.Fields |
---|
EMPTY_ARRAY |
Constructor Summary | |
---|---|
BlockTreeTermsReader(Directory dir,
FieldInfos fieldInfos,
SegmentInfo info,
PostingsReaderBase postingsReader,
IOContext ioContext,
String segmentSuffix,
int indexDivisor)
Sole constructor. |
Method Summary | |
---|---|
void |
close()
|
Iterator<String> |
iterator()
Returns an iterator that will step through all fields names. |
long |
ramBytesUsed()
Returns approximate RAM bytes used |
protected int |
readHeader(IndexInput input)
Reads terms file header. |
protected int |
readIndexHeader(IndexInput input)
Reads index file header. |
protected void |
seekDir(IndexInput input,
long dirOffset)
Seek input to the directory offset. |
int |
size()
Returns the number of fields or -1 if the number of distinct field names is unknown. |
Terms |
terms(String field)
Get the Terms for this field. |
Methods inherited from class org.apache.lucene.index.Fields |
---|
getUniqueTermCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlockTreeTermsReader(Directory dir, FieldInfos fieldInfos, SegmentInfo info, PostingsReaderBase postingsReader, IOContext ioContext, String segmentSuffix, int indexDivisor) throws IOException
IOException
Method Detail |
---|
protected int readHeader(IndexInput input) throws IOException
IOException
protected int readIndexHeader(IndexInput input) throws IOException
IOException
protected void seekDir(IndexInput input, long dirOffset) throws IOException
input
to the directory offset.
IOException
public void close() throws IOException
close
in interface Closeable
close
in class FieldsProducer
IOException
public Iterator<String> iterator()
Fields
iterator
in interface Iterable<String>
iterator
in class Fields
public Terms terms(String field) throws IOException
Fields
Terms
for this field. This will return
null if the field does not exist.
terms
in class Fields
IOException
public int size()
Fields
Fields.iterator()
will return as many field names.
size
in class Fields
public long ramBytesUsed()
FieldsProducer
ramBytesUsed
in class FieldsProducer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |