Package org.apache.lucene.index
Class FieldInfo
- java.lang.Object
-
- org.apache.lucene.index.FieldInfo
-
public final class FieldInfo extends java.lang.ObjectAccess 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldInfo.DocValuesTypeDocValues types.static classFieldInfo.IndexOptionsControls how much information is stored in the postings lists.
-
Constructor Summary
Constructors Constructor Description FieldInfo(java.lang.String name, boolean indexed, int number, boolean storeTermVector, boolean omitNorms, boolean storePayloads, FieldInfo.IndexOptions indexOptions, FieldInfo.DocValuesType docValues, FieldInfo.DocValuesType normsType, java.util.Map<java.lang.String,java.lang.String> attributes)Sole Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>attributes()Returns internal codec attributes map.java.lang.StringgetAttribute(java.lang.String key)Get a codec attribute value, or null if it does not existlonggetDocValuesGen()Returns the docValues generation of this field, or -1 if no docValues updates exist for it.FieldInfo.DocValuesTypegetDocValuesType()ReturnsFieldInfo.DocValuesTypeof the docValues.FieldInfo.IndexOptionsgetIndexOptions()Returns IndexOptions for the field, or null if the field is not indexedFieldInfo.DocValuesTypegetNormType()ReturnsFieldInfo.DocValuesTypeof the norm.booleanhasDocValues()Returns true if this field has any docValues.booleanhasNorms()Returns true if this field actually has any norms.booleanhasPayloads()Returns true if any payloads exist for this field.booleanhasVectors()Returns true if any term vectors exist for this field.booleanisIndexed()Returns true if this field is indexed.booleanomitsNorms()Returns true if norms are explicitly omitted for this fieldjava.lang.StringputAttribute(java.lang.String key, java.lang.String value)Puts a codec attribute value.voidsetDocValuesGen(long dvGen)Sets the docValues generation of this field.
-
-
-
Constructor Detail
-
FieldInfo
public FieldInfo(java.lang.String name, boolean indexed, int number, boolean storeTermVector, boolean omitNorms, boolean storePayloads, FieldInfo.IndexOptions indexOptions, FieldInfo.DocValuesType docValues, FieldInfo.DocValuesType normsType, java.util.Map<java.lang.String,java.lang.String> attributes)Sole Constructor.
-
-
Method Detail
-
getIndexOptions
public FieldInfo.IndexOptions getIndexOptions()
Returns IndexOptions for the field, or null if the field is not indexed
-
hasDocValues
public boolean hasDocValues()
Returns true if this field has any docValues.
-
getDocValuesType
public FieldInfo.DocValuesType getDocValuesType()
ReturnsFieldInfo.DocValuesTypeof the docValues. this may be null if the field has no docvalues.
-
setDocValuesGen
public 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.
-
getNormType
public FieldInfo.DocValuesType getNormType()
ReturnsFieldInfo.DocValuesTypeof the norm. this may be null if the field has no norms.
-
omitsNorms
public boolean omitsNorms()
Returns true if norms are explicitly omitted for this field
-
hasNorms
public boolean hasNorms()
Returns true if this field actually has any norms.
-
isIndexed
public boolean isIndexed()
Returns true if this field is indexed.
-
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
public java.lang.String getAttribute(java.lang.String key)
Get a codec attribute value, or null if it does not exist
-
putAttribute
public java.lang.String putAttribute(java.lang.String key, java.lang.String value)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 field, it will be replaced with the new value.
-
attributes
public java.util.Map<java.lang.String,java.lang.String> attributes()
Returns internal codec attributes map. May be null if no mappings exist.
-
-