Class TermVectorsWriter
Codec API for writing term vectors:
- For every document, StartDocument(Int32) is called, informing the Codec how many fields will be written.
- StartField(FieldInfo, Int32, Boolean, Boolean, Boolean) is called for each field in the document, informing the codec how many terms will be written for that field, and whether or not positions, offsets, or payloads are enabled.
- Within each field, StartTerm(BytesRef, Int32) is called for each term.
- If offsets and/or positions are enabled, then AddPosition(Int32, Int32, Int32, BytesRef) will be called for each term occurrence.
- After all documents have been written, Finish(FieldInfos, Int32) is called for verification/sanity-checks.
- Finally the writer is disposed (Dispose(Boolean))
@lucene.experimental
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public abstract class TermVectorsWriter : IDisposable
Constructors
Name | Description |
---|---|
TermVectorsWriter() | Sole constructor. (For invocation by subclass constructors, typically implicit.) |
Properties
Name | Description |
---|---|
Comparer | Return the IComparer<BytesRef> used to sort terms before feeding to this API. |
Methods
Name | Description |
---|---|
Abort() | Aborts writing entirely, implementation should remove any partially-written files, etc. |
AddAllDocVectors(Fields, MergeState) | Safe (but, slowish) default method to write every vector field in the document. |
AddPosition(Int32, Int32, Int32, BytesRef) | Adds a term |
AddProx(Int32, DataInput, DataInput) | Called by IndexWriter when writing new segments. This is an expert API that allows the codec to consume positions and offsets directly from the indexer. The default implementation calls AddPosition(Int32, Int32, Int32, BytesRef), but subclasses can override this if they want to efficiently write all the positions, then all the offsets, for example. NOTE: this API is extremely expert and subject to change or removal!!! @lucene.internal |
Dispose() | Disposes all resources used by this object. |
Dispose(Boolean) | Implementations must override and should dispose all resources used by this instance. |
Finish(FieldInfos, Int32) | Called before Dispose(Boolean), passing in the number of documents that were written. Note that this is intentionally redundant (equivalent to the number of calls to StartDocument(Int32), but a Codec should check that this is the case to detect the bug described in LUCENE-1282. |
FinishDocument() | Called after a doc and all its fields have been added. |
FinishField() | Called after a field and all its terms have been added. |
FinishTerm() | Called after a term and all its positions have been added. |
Merge(MergeState) | Merges in the term vectors from the readers in
|
StartDocument(Int32) | Called before writing the term vectors of the document.
StartField(FieldInfo, Int32, Boolean, Boolean, Boolean) will
be called |
StartField(FieldInfo, Int32, Boolean, Boolean, Boolean) | Called before writing the terms of the field.
StartTerm(BytesRef, Int32) will be called |
StartTerm(BytesRef, Int32) | Adds a |