Class Lucene60FieldInfosFormat
- java.lang.Object
-
- org.apache.lucene.codecs.FieldInfosFormat
-
- org.apache.lucene.codecs.lucene60.Lucene60FieldInfosFormat
-
public final class Lucene60FieldInfosFormat extends FieldInfosFormat
Lucene 6.0 Field Infos format.Field names are stored in the field info file, with suffix .fnm.
FieldInfos (.fnm) --> Header,FieldsCount, <FieldName,FieldNumber, FieldBits,DocValuesBits,DocValuesGen,Attributes,DimensionCount,DimensionNumBytes> FieldsCount,Footer
Data types:
- Header -->
IndexHeader
- FieldsCount -->
VInt
- FieldName -->
String
- FieldBits, IndexOptions, DocValuesBits -->
Byte
- FieldNumber, DimensionCount, DimensionNumBytes -->
VInt
- Attributes -->
Map<String,String>
- DocValuesGen -->
Int64
- Footer -->
CodecFooter
- FieldsCount: the number of fields in this file.
- FieldName: name of the field as a UTF-8 String.
- FieldNumber: the field's number. Note that unlike previous versions of Lucene, the fields are not numbered implicitly by their order in the file, instead explicitly.
- FieldBits: a byte containing field options.
- The low order bit (0x1) is one for fields that have term vectors stored, and zero for fields without term vectors.
- If the second lowest order-bit is set (0x2), norms are omitted for the indexed field.
- If the third lowest-order bit is set (0x4), payloads are stored for the indexed field.
- IndexOptions: a byte containing index options.
- 0: not indexed
- 1: indexed as DOCS_ONLY
- 2: indexed as DOCS_AND_FREQS
- 3: indexed as DOCS_AND_FREQS_AND_POSITIONS
- 4: indexed as DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS
- DocValuesBits: a byte containing per-document value types. The type
recorded as two four-bit integers, with the high-order bits representing
norms
options, and the low-order bits representingDocValues
options. Each four-bit integer can be decoded as such:- 0: no DocValues for this field.
- 1: NumericDocValues. (
DocValuesType.NUMERIC
) - 2: BinaryDocValues. (
DocValuesType#BINARY
) - 3: SortedDocValues. (
DocValuesType#SORTED
)
- DocValuesGen is the generation count of the field's DocValues. If this is -1,
there are no DocValues updates to that field. Anything above zero means there
are updates stored by
DocValuesFormat
. - Attributes: a key-value map of codec-private attributes.
- PointDimensionCount, PointNumBytes: these are non-zero only if the field is
indexed as points, e.g. using
LongPoint
- Header -->
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
CODEC_NAME
(package private) static java.lang.String
EXTENSION
Extension of field infos(package private) static int
FORMAT_CURRENT
(package private) static int
FORMAT_SELECTIVE_INDEXING
(package private) static int
FORMAT_SOFT_DELETES
(package private) static int
FORMAT_START
(package private) static byte
OMIT_NORMS
(package private) static byte
SOFT_DELETES_FIELD
(package private) static byte
STORE_PAYLOADS
(package private) static byte
STORE_TERMVECTOR
-
Constructor Summary
Constructors Constructor Description Lucene60FieldInfosFormat()
Sole constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static byte
docValuesByte(DocValuesType type)
private static DocValuesType
getDocValuesType(IndexInput input, byte b)
private static IndexOptions
getIndexOptions(IndexInput input, byte b)
private static byte
indexOptionsByte(IndexOptions indexOptions)
FieldInfos
read(Directory directory, SegmentInfo segmentInfo, java.lang.String segmentSuffix, IOContext context)
void
write(Directory directory, SegmentInfo segmentInfo, java.lang.String segmentSuffix, FieldInfos infos, IOContext context)
Writes the providedFieldInfos
to the directory.
-
-
-
Field Detail
-
EXTENSION
static final java.lang.String EXTENSION
Extension of field infos- See Also:
- Constant Field Values
-
CODEC_NAME
static final java.lang.String CODEC_NAME
- See Also:
- Constant Field Values
-
FORMAT_START
static final int FORMAT_START
- See Also:
- Constant Field Values
-
FORMAT_SOFT_DELETES
static final int FORMAT_SOFT_DELETES
- See Also:
- Constant Field Values
-
FORMAT_SELECTIVE_INDEXING
static final int FORMAT_SELECTIVE_INDEXING
- See Also:
- Constant Field Values
-
FORMAT_CURRENT
static final int FORMAT_CURRENT
- See Also:
- Constant Field Values
-
STORE_TERMVECTOR
static final byte STORE_TERMVECTOR
- See Also:
- Constant Field Values
-
OMIT_NORMS
static final byte OMIT_NORMS
- See Also:
- Constant Field Values
-
STORE_PAYLOADS
static final byte STORE_PAYLOADS
- See Also:
- Constant Field Values
-
SOFT_DELETES_FIELD
static final byte SOFT_DELETES_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public FieldInfos read(Directory directory, SegmentInfo segmentInfo, java.lang.String segmentSuffix, IOContext context) throws java.io.IOException
Description copied from class:FieldInfosFormat
Read theFieldInfos
previously written withFieldInfosFormat.write(org.apache.lucene.store.Directory, org.apache.lucene.index.SegmentInfo, java.lang.String, org.apache.lucene.index.FieldInfos, org.apache.lucene.store.IOContext)
.- Specified by:
read
in classFieldInfosFormat
- Throws:
java.io.IOException
-
docValuesByte
private static byte docValuesByte(DocValuesType type)
-
getDocValuesType
private static DocValuesType getDocValuesType(IndexInput input, byte b) throws java.io.IOException
- Throws:
java.io.IOException
-
indexOptionsByte
private static byte indexOptionsByte(IndexOptions indexOptions)
-
getIndexOptions
private static IndexOptions getIndexOptions(IndexInput input, byte b) throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(Directory directory, SegmentInfo segmentInfo, java.lang.String segmentSuffix, FieldInfos infos, IOContext context) throws java.io.IOException
Description copied from class:FieldInfosFormat
Writes the providedFieldInfos
to the directory.- Specified by:
write
in classFieldInfosFormat
- Throws:
java.io.IOException
-
-