Class StoredFieldsWriter
Codec API for writing stored fields:
- For every document, Start
Document(Int32) is called, informing the Codec how many fields will be written. - Write
Field(Field is called for each field in the document.Info, IIndexable Field) - After all documents have been written, Finish(Field
Infos, Int32) is called for verification/sanity-checks. - Finally the writer is disposed (Dispose(Boolean))
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Codecs
Assembly: Lucene.Net.dll
Syntax
public abstract class StoredFieldsWriter : IDisposable
Constructors
| Improve this Doc View SourceStoredFieldsWriter()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
protected StoredFieldsWriter()
Methods
| Improve this Doc View SourceAbort()
Aborts writing entirely, implementation should remove any partially-written files, etc.
Declaration
public abstract void Abort()
AddDocument<T1>(IEnumerable<T1>, FieldInfos)
Sugar method for Start
Declaration
protected void AddDocument<T1>(IEnumerable<T1> doc, FieldInfos fieldInfos)
where T1 : IIndexableField
Parameters
Type | Name | Description |
---|---|---|
System. |
doc | |
Field |
fieldInfos |
Type Parameters
Name | Description |
---|---|
T1 |
Dispose()
Disposes all resources used by this object.
Declaration
public void Dispose()
Dispose(Boolean)
Implementations must override and should dispose all resources used by this instance.
Declaration
protected abstract void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System. |
disposing |
Finish(FieldInfos, Int32)
Called before Dispose(), passing in the number
of documents that were written. Note that this is
intentionally redundant (equivalent to the number of
calls to Start
Declaration
public abstract void Finish(FieldInfos fis, int numDocs)
Parameters
Type | Name | Description |
---|---|---|
Field |
fis | |
System. |
numDocs |
FinishDocument()
Called when a document and all its fields have been added.
Declaration
public virtual void FinishDocument()
Merge(MergeState)
Merges in the stored fields from the readers in
mergeState
. The default implementation skips
over deleted documents, and uses Start
Declaration
public virtual int Merge(MergeState mergeState)
Parameters
Type | Name | Description |
---|---|---|
Merge |
mergeState |
Returns
Type | Description |
---|---|
System. |
StartDocument(Int32)
Called before writing the stored fields of the document.
WritenumStoredFields
times. Note that this is
called even if the document has no stored fields, in
this case numStoredFields
will be zero.
Declaration
public abstract void StartDocument(int numStoredFields)
Parameters
Type | Name | Description |
---|---|---|
System. |
numStoredFields |
WriteField(FieldInfo, IIndexableField)
Writes a single stored field.
Declaration
public abstract void WriteField(FieldInfo info, IIndexableField field)
Parameters
Type | Name | Description |
---|---|---|
Field |
info | |
IIndexable |
field |