org.apache.lucene.index
Class FieldInfo

java.lang.Object
  extended by org.apache.lucene.index.FieldInfo

public final class FieldInfo
extends Object

Access to the Fieldable Info file that describes document fields and whether or not they are indexed. Each segment has a separate Fieldable 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
static class FieldInfo.IndexOptions
          Controls how much information is stored in the postings lists.
 
Field Summary
 String name
           
 int number
           
 
Constructor Summary
FieldInfo(String name, boolean indexed, int number, boolean storeTermVector, boolean omitNorms, boolean storePayloads, FieldInfo.IndexOptions indexOptions, DocValues.Type docValues, DocValues.Type normsType, Map<String,String> attributes)
           
 
Method Summary
 Map<String,String> attributes()
           
 String getAttribute(String key)
          Get a codec attribute value, or null if it does not exist
 DocValues.Type getDocValuesType()
           
 FieldInfo.IndexOptions getIndexOptions()
           
 DocValues.Type getNormType()
           
 boolean hasDocValues()
           
 boolean hasNorms()
           
 boolean hasPayloads()
           
 boolean hasVectors()
           
 boolean isIndexed()
           
 boolean omitsNorms()
           
 String putAttribute(String key, String value)
          Puts a codec attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final String name

number

public final int number
Constructor Detail

FieldInfo

public FieldInfo(String name,
                 boolean indexed,
                 int number,
                 boolean storeTermVector,
                 boolean omitNorms,
                 boolean storePayloads,
                 FieldInfo.IndexOptions indexOptions,
                 DocValues.Type docValues,
                 DocValues.Type normsType,
                 Map<String,String> attributes)
WARNING: This API is experimental and might change in incompatible ways in the next release.
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 DocValues.Type getDocValuesType()
Returns:
DocValues.Type of the docValues. this may be null if the field has no docvalues.

getNormType

public DocValues.Type getNormType()
Returns:
DocValues.Type of 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 String getAttribute(String key)
Get a codec attribute value, or null if it does not exist


putAttribute

public String putAttribute(String key,
                           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 Map<String,String> attributes()
Returns:
internal codec attributes map. May be null if no mappings exist.


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.