Class Lucene40StoredFieldsFormat
Lucene 4.0 Stored Fields Format.
Stored fields are represented by two files:
The field index, or
.fdx
file.This is used to find the location within the field data file of the fields of a particular document. Because it contains fixed-length data, this file may be easily randomly accessed. The position of document n 's field data is the Uint64 (WriteInt64(long)) at n*8 in this file.
This contains, for each document, a pointer to its field data, as follows:
- FieldIndex (.fdx) --> <Header>, <FieldValuesPosition> SegSize
- Header --> CodecHeader (WriteHeader(DataOutput, string, int))
- FieldValuesPosition --> Uint64 (WriteInt64(long))
This contains the stored fields of each document, as follows:
- FieldData (.fdt) --> <Header>, <DocFieldData> SegSize
- Header --> CodecHeader (WriteHeader(DataOutput, string, int))
- DocFieldData --> FieldCount, <FieldNum, Bits, Value> FieldCount
- FieldCount --> VInt (WriteVInt32(int))
- FieldNum --> VInt (WriteVInt32(int))
- Bits --> Byte (WriteByte(byte))
- low order bit reserved.
- second bit is one for fields containing binary data
- third bit reserved.
- 4th to 6th bit (mask: 0x7<<3) define the type of a numeric field:
- all bits in mask are cleared if no numeric field at all
- 1<<3: Value is Int
- 2<<3: Value is Long
- 3<<3: Value is Int as Float (as of Int32BitsToSingle(int)
- 4<<3: Value is Long as Double (as of Int64BitsToDouble(long)
- Value --> String | BinaryValue | Int | Long (depending on Bits)
- BinaryValue --> ValueSize, < Byte (WriteByte(byte)) >^ValueSize
- ValueSize --> VInt (WriteVInt32(int))
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Codecs.Lucene40
Assembly: Lucene.Net.dll
Syntax
public class Lucene40StoredFieldsFormat : StoredFieldsFormat
Constructors
Lucene40StoredFieldsFormat()
Sole constructor.
Declaration
public Lucene40StoredFieldsFormat()
Methods
FieldsReader(Directory, SegmentInfo, FieldInfos, IOContext)
Returns a StoredFieldsReader to load stored fields.
Declaration
public override StoredFieldsReader FieldsReader(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | |
SegmentInfo | si | |
FieldInfos | fn | |
IOContext | context |
Returns
Type | Description |
---|---|
StoredFieldsReader |
Overrides
FieldsWriter(Directory, SegmentInfo, IOContext)
Returns a StoredFieldsWriter to write stored fields.
Declaration
public override StoredFieldsWriter FieldsWriter(Directory directory, SegmentInfo si, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | directory | |
SegmentInfo | si | |
IOContext | context |
Returns
Type | Description |
---|---|
StoredFieldsWriter |