Class Lucene40TermVectorsWriter
Lucene 4.0 Term Vectors writer.
It writes .tvd, .tvf, and .tvx files.Implements
Inherited Members
Namespace: Lucene.Net.Codecs.Lucene40
Assembly: Lucene.Net.dll
Syntax
public sealed class Lucene40TermVectorsWriter : TermVectorsWriter, IDisposable
Constructors
Lucene40TermVectorsWriter(Directory, string, IOContext)
Sole constructor.
Declaration
public Lucene40TermVectorsWriter(Directory directory, string segment, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | |
string | segment | |
IOContext | context |
See Also
Properties
Comparer
Return the IComparer{BytesRef} used to sort terms before feeding to this API.
Declaration
public override IComparer<BytesRef> Comparer { get; }
Property Value
Type | Description |
---|---|
IComparer<BytesRef> |
Overrides
See Also
Methods
Abort()
Aborts writing entirely, implementation should remove any partially-written files, etc.
Declaration
public override void Abort()
Overrides
See Also
AddPosition(int, int, int, BytesRef)
Adds a term position
and offsets.
Declaration
public override void AddPosition(int position, int startOffset, int endOffset, BytesRef payload)
Parameters
Type | Name | Description |
---|---|---|
int | position | |
int | startOffset | |
int | endOffset | |
BytesRef | payload |
Overrides
See Also
AddProx(int, 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(int, int, int, 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!!!Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public override void AddProx(int numProx, DataInput positions, DataInput offsets)
Parameters
Type | Name | Description |
---|---|---|
int | numProx | |
DataInput | positions | |
DataInput | offsets |
Overrides
See Also
Dispose(bool)
Close all streams.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
See Also
Finish(FieldInfos, int)
Called before Dispose(bool), passing in the number of documents that were written. Note that this is intentionally redundant (equivalent to the number of calls to StartDocument(int), but a Codec should check that this is the case to detect the bug described in LUCENE-1282.
Declaration
public override void Finish(FieldInfos fis, int numDocs)
Parameters
Type | Name | Description |
---|---|---|
FieldInfos | fis | |
int | numDocs |
Overrides
See Also
FinishDocument()
Called after a doc and all its fields have been added.
Declaration
public override void FinishDocument()
Overrides
See Also
FinishTerm()
Called after a term and all its positions have been added.
Declaration
public override void FinishTerm()
Overrides
See Also
Merge(MergeState)
Merges in the term vectors from the readers in
mergeState
. The default implementation skips
over deleted documents, and uses StartDocument(int),
StartField(FieldInfo, int, bool, bool, bool),
StartTerm(BytesRef, int), AddPosition(int, int, int, BytesRef),
and Finish(FieldInfos, int),
returning the number of documents that were written.
Implementations can override this method for more sophisticated
merging (bulk-byte copying, etc).
Declaration
public override int Merge(MergeState mergeState)
Parameters
Type | Name | Description |
---|---|---|
MergeState | mergeState |
Returns
Type | Description |
---|---|
int |
Overrides
See Also
StartDocument(int)
Called before writing the term vectors of the document.
StartField(FieldInfo, int, bool, bool, bool) will
be called numVectorFields
times. Note that if term
vectors are enabled, this is called even if the document
has no vector fields, in this case numVectorFields
will be zero.
Declaration
public override void StartDocument(int numVectorFields)
Parameters
Type | Name | Description |
---|---|---|
int | numVectorFields |
Overrides
See Also
StartField(FieldInfo, int, bool, bool, bool)
Called before writing the terms of the field.
StartTerm(BytesRef, int) will be called numTerms
times.
Declaration
public override void StartField(FieldInfo info, int numTerms, bool positions, bool offsets, bool payloads)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | info | |
int | numTerms | |
bool | positions | |
bool | offsets | |
bool | payloads |
Overrides
See Also
StartTerm(BytesRef, int)
Adds a term
and its term frequency freq
.
If this field has positions and/or offsets enabled, then
AddPosition(int, int, int, BytesRef) will be called
freq
times respectively.
Declaration
public override void StartTerm(BytesRef term, int freq)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | term | |
int | freq |