Class Lucene40PostingsWriter
Concrete class that writes the 4.0 frq/prx postings format.
Note
This API is experimental and might change in incompatible ways in the next release.
Implements
Inherited Members
Namespace: Lucene.Net.Codecs.Lucene40
Assembly: Lucene.Net.TestFramework.dll
Syntax
public sealed class Lucene40PostingsWriter : PostingsWriterBase, IDisposable
Constructors
Lucene40PostingsWriter(SegmentWriteState)
Creates a Lucene40PostingsWriter, with the DEFAULT_SKIP_INTERVAL.
Declaration
public Lucene40PostingsWriter(SegmentWriteState state)
Parameters
| Type | Name | Description |
|---|---|---|
| SegmentWriteState | state |
See Also
Lucene40PostingsWriter(SegmentWriteState, int)
Creates a Lucene40PostingsWriter, with the
specified skipInterval.
Declaration
public Lucene40PostingsWriter(SegmentWriteState state, int skipInterval)
Parameters
| Type | Name | Description |
|---|---|---|
| SegmentWriteState | state | |
| int | skipInterval |
See Also
Methods
AddPosition(int, BytesRef, int, int)
Add a new position & payload.
Declaration
public override void AddPosition(int position, BytesRef payload, int startOffset, int endOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| int | position | |
| BytesRef | payload | |
| int | startOffset | |
| int | endOffset |
Overrides
See Also
Dispose(bool)
Implementations must override and should dispose all resources used by this instance.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
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 override void EncodeTerm(long[] empty, DataOutput @out, FieldInfo fieldInfo, BlockTermState state, bool absolute)
Parameters
| Type | Name | Description |
|---|---|---|
| long[] | empty | |
| DataOutput | out | |
| FieldInfo | fieldInfo | |
| BlockTermState | state | |
| bool | absolute |
Overrides
See Also
FinishDoc()
Called when we are done adding positions & payloads for each doc.
Declaration
public override void FinishDoc()
Overrides
See Also
FinishTerm(BlockTermState)
Called when we are done adding docs to this term.
Declaration
public override void FinishTerm(BlockTermState state)
Parameters
| Type | Name | Description |
|---|---|---|
| BlockTermState | state |
Overrides
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 override void Init(IndexOutput termsOut)
Parameters
| Type | Name | Description |
|---|---|---|
| IndexOutput | termsOut |
Overrides
See Also
NewTermState()
Return a newly created empty Lucene.Net.Index.TermState
Declaration
public override BlockTermState NewTermState()
Returns
| Type | Description |
|---|---|
| BlockTermState |
Overrides
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 override int SetField(FieldInfo fieldInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | fieldInfo |
Returns
| Type | Description |
|---|---|
| int |
Overrides
See Also
StartDoc(int, int)
Adds a new doc in this term.
freq will be -1 when term frequencies are omitted
for the field.
Declaration
public override void StartDoc(int docID, int termDocFreq)
Parameters
| Type | Name | Description |
|---|---|---|
| int | docID | |
| int | termDocFreq |
Overrides
See Also
StartTerm()
Start a new term. Note that a matching call to Lucene.Net.Codecs.PostingsWriterBase.FinishTerm(Lucene.Net.Codecs.BlockTermState) is done, only if the term has at least one document.
Declaration
public override void StartTerm()