C# Class Lucene.Net.Codecs.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 Lucene.Net.Index.CheckIndex with the -verbose option to see summary statistics on the blocks in the dictionary. See BlockTreeTermsWriter. @lucene.experimental

Inheritance: Lucene.Net.Codecs.FieldsProducer
Show file Open project: apache/lucenenet Class Usage Examples

Public Methods

Method Description
BlockTreeTermsReader ( Directory dir, FieldInfos fieldInfos, SegmentInfo info, Lucene.Net.Codecs.PostingsReaderBase postingsReader, IOContext ioContext, string segmentSuffix, int indexDivisor ) : System

Sole constructor.

CheckIntegrity ( ) : void
Dispose ( ) : void
GetEnumerator ( ) : IEnumerator
RamBytesUsed ( ) : long
Terms ( string field ) : Terms

Protected Methods

Method Description
ReadHeader ( IndexInput input ) : int

Reads terms file header.

ReadIndexHeader ( IndexInput input ) : int

Reads index file header.

SeekDir ( IndexInput input, long dirOffset ) : void

Seek {@code input} to the directory offset.

Private Methods

Method Description
BrToString ( BytesRef b ) : string
InitializeInstanceFields ( ) : void

Method Details

BlockTreeTermsReader() public method

Sole constructor.
public BlockTreeTermsReader ( Directory dir, FieldInfos fieldInfos, SegmentInfo info, Lucene.Net.Codecs.PostingsReaderBase postingsReader, IOContext ioContext, string segmentSuffix, int indexDivisor ) : System
dir Directory
fieldInfos FieldInfos
info SegmentInfo
postingsReader Lucene.Net.Codecs.PostingsReaderBase
ioContext IOContext
segmentSuffix string
indexDivisor int
return System

CheckIntegrity() public method

public CheckIntegrity ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

GetEnumerator() public method

public GetEnumerator ( ) : IEnumerator
return IEnumerator

RamBytesUsed() public method

public RamBytesUsed ( ) : long
return long

ReadHeader() protected method

Reads terms file header.
protected ReadHeader ( IndexInput input ) : int
input IndexInput
return int

ReadIndexHeader() protected method

Reads index file header.
protected ReadIndexHeader ( IndexInput input ) : int
input IndexInput
return int

SeekDir() protected method

Seek {@code input} to the directory offset.
protected SeekDir ( IndexInput input, long dirOffset ) : void
input IndexInput
dirOffset long
return void

Terms() public method

public Terms ( string field ) : Terms
field string
return Terms