Package org.apache.lucene.index
Class FieldInfo
java.lang.Object
org.apache.lucene.index.FieldInfo
Access to the Field Info file that describes document fields and whether or
not they are indexed. Each segment has a separate Field Info file. Objects
of this class are thread-safe for multiple readers, but only one thread can
be adding documents at a time, with no other reader or writer threads
accessing this object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DocValuesTypeprivate longprivate IndexOptionsfinal StringField's namefinal intInternal field numberprivate booleanprivate intIf both of these are positive it means this field indexed points (seePointsFormat).private intprivate intprivate final booleanprivate booleanprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionFieldInfo(String name, int number, boolean storeTermVector, boolean omitNorms, boolean storePayloads, IndexOptions indexOptions, DocValuesType docValues, long dvGen, Map<String, String> attributes, int pointDimensionCount, int pointIndexDimensionCount, int pointNumBytes, boolean softDeletesField) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns internal codec attributes map.booleanPerforms internal consistency checks.getAttribute(String key) Get a codec attribute value, or null if it does not existlongReturns the docValues generation of this field, or -1 if no docValues updates exist for it.ReturnsDocValuesTypeof the docValues; this isDocValuesType.NONEif the field has no docvalues.Returns IndexOptions for the field, or IndexOptions.NONE if the field is not indexedintReturn point data dimension countintReturn point data dimension countintReturn number of bytes per dimensionbooleanhasNorms()Returns true if this field actually has any norms.booleanReturns true if any payloads exist for this field.booleanReturns true if any term vectors exist for this field.booleanReturns true if this field is configured and used as the soft-deletes field.booleanReturns true if norms are explicitly omitted for this fieldputAttribute(String key, String value) Puts a codec attribute value.(package private) voidsetDocValuesGen(long dvGen) Sets the docValues generation of this field.voidRecord that this field is indexed with docvalues, with the specified typevoidsetIndexOptions(IndexOptions newIndexOptions) Record theIndexOptionsto use with this field.voidOmit norms for this field.voidsetPointDimensions(int dimensionCount, int indexDimensionCount, int numBytes) Record that this field is indexed with points, with the specified number of dimensions and bytes per dimension.(package private) void(package private) void(package private) voidupdate(boolean storeTermVector, boolean omitNorms, boolean storePayloads, IndexOptions indexOptions, Map<String, String> attributes, int dimensionCount, int indexDimensionCount, int dimensionNumBytes)
-
Field Details
-
name
Field's name -
number
public final int numberInternal field number -
docValuesType
-
storeTermVector
private boolean storeTermVector -
omitNorms
private boolean omitNorms -
indexOptions
-
storePayloads
private boolean storePayloads -
attributes
-
dvGen
private long dvGen -
pointDimensionCount
private int pointDimensionCountIf both of these are positive it means this field indexed points (seePointsFormat). -
pointIndexDimensionCount
private int pointIndexDimensionCount -
pointNumBytes
private int pointNumBytes -
softDeletesField
private final boolean softDeletesField
-
-
Constructor Details
-
FieldInfo
public FieldInfo(String name, int number, boolean storeTermVector, boolean omitNorms, boolean storePayloads, IndexOptions indexOptions, DocValuesType docValues, long dvGen, Map<String, String> attributes, int pointDimensionCount, int pointIndexDimensionCount, int pointNumBytes, boolean softDeletesField) Sole constructor.
-
-
Method Details
-
checkConsistency
public boolean checkConsistency()Performs internal consistency checks. Always returns true (or throws IllegalStateException) -
update
void update(boolean storeTermVector, boolean omitNorms, boolean storePayloads, IndexOptions indexOptions, Map<String, String> attributes, int dimensionCount, int indexDimensionCount, int dimensionNumBytes) -
setPointDimensions
public void setPointDimensions(int dimensionCount, int indexDimensionCount, int numBytes) Record that this field is indexed with points, with the specified number of dimensions and bytes per dimension. -
getPointDimensionCount
public int getPointDimensionCount()Return point data dimension count -
getPointIndexDimensionCount
public int getPointIndexDimensionCount()Return point data dimension count -
getPointNumBytes
public int getPointNumBytes()Return number of bytes per dimension -
setDocValuesType
Record that this field is indexed with docvalues, with the specified type -
getIndexOptions
Returns IndexOptions for the field, or IndexOptions.NONE if the field is not indexed -
setIndexOptions
Record theIndexOptionsto use with this field. -
getDocValuesType
ReturnsDocValuesTypeof the docValues; this isDocValuesType.NONEif the field has no docvalues. -
setDocValuesGen
void setDocValuesGen(long dvGen) Sets the docValues generation of this field. -
getDocValuesGen
public long getDocValuesGen()Returns the docValues generation of this field, or -1 if no docValues updates exist for it. -
setStoreTermVectors
void setStoreTermVectors() -
setStorePayloads
void setStorePayloads() -
omitsNorms
public boolean omitsNorms()Returns true if norms are explicitly omitted for this field -
setOmitsNorms
public void setOmitsNorms()Omit norms for this field. -
hasNorms
public boolean hasNorms()Returns true if this field actually has any norms. -
hasPayloads
public boolean hasPayloads()Returns true if any payloads exist for this field. -
hasVectors
public boolean hasVectors()Returns true if any term vectors exist for this field. -
getAttribute
Get a codec attribute value, or null if it does not exist -
putAttribute
Puts a codec attribute value.This is a key-value mapping for the field that the codec can use to store additional metadata, and will be available to the codec when reading the segment via
getAttribute(String)If a value already exists for the key in the field, it will be replaced with the new value. If the value of the attributes for a same field is changed between the documents, the behaviour after merge is undefined.
-
attributes
Returns internal codec attributes map. -
isSoftDeletesField
public boolean isSoftDeletesField()Returns true if this field is configured and used as the soft-deletes field. SeeLiveIndexWriterConfig.softDeletesField
-