Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class Lucene40StoredFieldsWriter

    Class responsible for writing stored document fields.

    It uses <segment>.fdt and <segment>.fdx; files.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    StoredFieldsWriter
    Lucene40StoredFieldsWriter
    Implements
    IDisposable
    Inherited Members
    StoredFieldsWriter.FinishDocument()
    StoredFieldsWriter.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Codecs.Lucene40
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class Lucene40StoredFieldsWriter : StoredFieldsWriter, IDisposable

    Constructors

    Lucene40StoredFieldsWriter(Directory, string, IOContext)

    Sole constructor.

    Declaration
    public Lucene40StoredFieldsWriter(Directory directory, string segment, IOContext context)
    Parameters
    Type Name Description
    Directory directory
    string segment
    IOContext context
    See Also
    Lucene40StoredFieldsFormat

    Fields

    FIELDS_EXTENSION

    Extension of stored fields file.

    Declaration
    public const string FIELDS_EXTENSION = "fdt"
    Field Value
    Type Description
    string
    See Also
    Lucene40StoredFieldsFormat

    FIELDS_INDEX_EXTENSION

    Extension of stored fields index file.

    Declaration
    public const string FIELDS_INDEX_EXTENSION = "fdx"
    Field Value
    Type Description
    string
    See Also
    Lucene40StoredFieldsFormat

    Methods

    Abort()

    Aborts writing entirely, implementation should remove any partially-written files, etc.

    Declaration
    public override void Abort()
    Overrides
    StoredFieldsWriter.Abort()
    See Also
    Lucene40StoredFieldsFormat

    AddRawDocuments(IndexInput, int[], int)

    Bulk write a contiguous series of documents. The lengths array is the length (in bytes) of each raw document. The streamIndexInput is the fieldsStream from which we should bulk-copy all bytes.

    Declaration
    public void AddRawDocuments(IndexInput stream, int[] lengths, int numDocs)
    Parameters
    Type Name Description
    IndexInput stream
    int[] lengths
    int numDocs
    See Also
    Lucene40StoredFieldsFormat

    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
    StoredFieldsWriter.Dispose(bool)
    See Also
    Lucene40StoredFieldsFormat

    Finish(FieldInfos, int)

    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 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
    StoredFieldsWriter.Finish(FieldInfos, int)
    See Also
    Lucene40StoredFieldsFormat

    Merge(MergeState)

    Merges in the stored fields from the readers in mergeState. The default implementation skips over deleted documents, and uses StartDocument(int), WriteField(FieldInfo, IIndexableField), 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
    StoredFieldsWriter.Merge(MergeState)
    See Also
    Lucene40StoredFieldsFormat

    StartDocument(int)

    Called before writing the stored fields of the document. WriteField(FieldInfo, IIndexableField) will be called numStoredFields times. Note that this is called even if the document has no stored fields, in this case numStoredFields will be zero.

    Declaration
    public override void StartDocument(int numStoredFields)
    Parameters
    Type Name Description
    int numStoredFields
    Overrides
    StoredFieldsWriter.StartDocument(int)
    See Also
    Lucene40StoredFieldsFormat

    WriteField(FieldInfo, IIndexableField)

    Writes a single stored field.

    Declaration
    public override void WriteField(FieldInfo info, IIndexableField field)
    Parameters
    Type Name Description
    FieldInfo info
    IIndexableField field
    Overrides
    StoredFieldsWriter.WriteField(FieldInfo, IIndexableField)
    See Also
    Lucene40StoredFieldsFormat

    Implements

    IDisposable

    See Also

    Lucene40StoredFieldsFormat
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.