C# Class Lucene.Net.Index.TermContext

Maintains a IndexReader TermState view over IndexReader instances containing a single term. The TermContext doesn't track if the given TermState objects are valid, neither if the TermState instances refer to the same terms in the associated readers. @lucene.experimental
Mostra file Open project: paulirwin/lucene.net Class Usage Examples

Public Properties

Property Type Description
TopReaderContext Lucene.Net.Index.IndexReaderContext

Public Methods

Method Description
Build ( Lucene.Net.Index.IndexReaderContext context, Lucene.Net.Index.Term term ) : TermContext

Creates a TermContext from a top-level IndexReaderContext and the given Term. this method will lookup the given term in all context's leaf readers and register each of the readers containing the term in the returned TermContext using the leaf reader's ordinal.

Note: the given context must be a top-level context.

Clear ( ) : void

Clears the TermContext internal state and removes all registered TermStates

Get ( int ord ) : Lucene.Net.Index.TermState

Returns the TermState for an leaf ordinal or null if no TermState for the ordinal was registered.

Register ( Lucene.Net.Index.TermState state, int ord, int docFreq, long totalTermFreq ) : void

Registers and associates a TermState with an leaf ordinal. The leaf ordinal should be derived from a IndexReaderContext's leaf ord.

TermContext ( Lucene.Net.Index.IndexReaderContext context ) : System.Diagnostics

Creates an empty TermContext from a IndexReaderContext

TermContext ( Lucene.Net.Index.IndexReaderContext context, Lucene.Net.Index.TermState state, int ord, int docFreq, long totalTermFreq ) : System.Diagnostics

Creates a TermContext with an initial TermState, IndexReader pair.

TotalTermFreq ( ) : long

Returns the accumulated term frequency of all TermState instances passed to #register(TermState, int, int, long).

Method Details

Build() public static method

Creates a TermContext from a top-level IndexReaderContext and the given Term. this method will lookup the given term in all context's leaf readers and register each of the readers containing the term in the returned TermContext using the leaf reader's ordinal.

Note: the given context must be a top-level context.

public static Build ( Lucene.Net.Index.IndexReaderContext context, Lucene.Net.Index.Term term ) : TermContext
context Lucene.Net.Index.IndexReaderContext
term Lucene.Net.Index.Term
return TermContext

Clear() public method

Clears the TermContext internal state and removes all registered TermStates
public Clear ( ) : void
return void

Get() public method

Returns the TermState for an leaf ordinal or null if no TermState for the ordinal was registered.
public Get ( int ord ) : Lucene.Net.Index.TermState
ord int /// the readers leaf ordinal to get the for.
return Lucene.Net.Index.TermState

Register() public method

Registers and associates a TermState with an leaf ordinal. The leaf ordinal should be derived from a IndexReaderContext's leaf ord.
public Register ( Lucene.Net.Index.TermState state, int ord, int docFreq, long totalTermFreq ) : void
state Lucene.Net.Index.TermState
ord int
docFreq int
totalTermFreq long
return void

TermContext() public method

Creates an empty TermContext from a IndexReaderContext
public TermContext ( Lucene.Net.Index.IndexReaderContext context ) : System.Diagnostics
context Lucene.Net.Index.IndexReaderContext
return System.Diagnostics

TermContext() public method

Creates a TermContext with an initial TermState, IndexReader pair.
public TermContext ( Lucene.Net.Index.IndexReaderContext context, Lucene.Net.Index.TermState state, int ord, int docFreq, long totalTermFreq ) : System.Diagnostics
context Lucene.Net.Index.IndexReaderContext
state Lucene.Net.Index.TermState
ord int
docFreq int
totalTermFreq long
return System.Diagnostics

TotalTermFreq() public method

Returns the accumulated term frequency of all TermState instances passed to #register(TermState, int, int, long).
public TotalTermFreq ( ) : long
return long

Property Details

TopReaderContext public_oe property

Holds the IndexReaderContext of the top-level IndexReader, used internally only for asserting. @lucene.internal
public IndexReaderContext,Lucene.Net.Index TopReaderContext
return Lucene.Net.Index.IndexReaderContext