Class PostingsWriterBase
Extension of PostingsConsumer to support pluggable term dictionaries.
This class contains additional hooks to interact with the provided term dictionaries such as BlockTreeTermsWriter<TSubclassState>. If you want to re-use an existing implementation and are only interested in customizing the format of the postings list, extend this class instead.Note
This API is experimental and might change in incompatible ways in the next release.
Implements
Inherited Members
Namespace: Lucene.Net.Codecs
Assembly: Lucene.Net.dll
Syntax
public abstract class PostingsWriterBase : PostingsConsumer, IDisposable
Constructors
PostingsWriterBase()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
protected PostingsWriterBase()
See Also
Methods
Dispose()
Disposes all resources used by this object.
Declaration
public void Dispose()
See Also
Dispose(bool)
Implementations must override and should dispose all resources used by this instance.
Declaration
protected abstract void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
See Also
EncodeTerm(long[], DataOutput, FieldInfo, BlockTermState, bool)
Encode metadata as long[] and byte[]. absolute
controls whether
current term is delta encoded according to latest term.
Usually elements in longs
are file pointers, so each one always
increases when a new term is consumed. out
is used to write generic
bytes, which are not monotonic.
Declaration
public abstract void EncodeTerm(long[] longs, DataOutput @out, FieldInfo fieldInfo, BlockTermState state, bool absolute)
Parameters
Type | Name | Description |
---|---|---|
long[] | longs | |
DataOutput | out | |
FieldInfo | fieldInfo | |
BlockTermState | state | |
bool | absolute |
See Also
FinishTerm(BlockTermState)
Finishes the current term. The provided BlockTermState contains the term's summary statistics, and will holds metadata from PBF when returned.
Declaration
public abstract void FinishTerm(BlockTermState state)
Parameters
Type | Name | Description |
---|---|---|
BlockTermState | state |
See Also
Init(IndexOutput)
Called once after startup, before any terms have been
added. Implementations typically write a header to
the provided termsOut
.
Declaration
public abstract void Init(IndexOutput termsOut)
Parameters
Type | Name | Description |
---|---|---|
IndexOutput | termsOut |
See Also
NewTermState()
Return a newly created empty TermState
Declaration
public abstract BlockTermState NewTermState()
Returns
Type | Description |
---|---|
BlockTermState |
See Also
SetField(FieldInfo)
Sets the current field for writing, and returns the fixed length of long[] metadata (which is fixed per field), called when the writing switches to another field.
Declaration
public abstract int SetField(FieldInfo fieldInfo)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | fieldInfo |
Returns
Type | Description |
---|---|
int |
See Also
StartTerm()
Start a new term. Note that a matching call to FinishTerm(BlockTermState) is done, only if the term has at least one document.
Declaration
public abstract void StartTerm()