org.apache.lucene.index
Enum DocValues.Type

java.lang.Object
  extended by java.lang.Enum<DocValues.Type>
      extended by org.apache.lucene.index.DocValues.Type
All Implemented Interfaces:
Serializable, Comparable<DocValues.Type>
Enclosing class:
DocValues

public static enum DocValues.Type
extends Enum<DocValues.Type>

Type specifies the DocValues type for a certain field. A Type only defines the data type for a field while the actual implementation used to encode and decode the values depends on the the DocValuesFormat.docsConsumer(org.apache.lucene.index.PerDocWriteState) and DocValuesFormat.docsProducer(org.apache.lucene.index.SegmentReadState) methods.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Enum Constant Summary
BYTES_FIXED_DEREF
          A fixed length dereferenced byte[] variant.
BYTES_FIXED_SORTED
          A fixed length pre-sorted byte[] variant.
BYTES_FIXED_STRAIGHT
          A fixed length straight byte[].
BYTES_VAR_DEREF
          A variable length dereferenced byte[].
BYTES_VAR_SORTED
          A variable length pre-sorted byte[] variant.
BYTES_VAR_STRAIGHT
          Variable length straight stored byte[] variant.
FIXED_INTS_16
          A 16 bit signed integer value.
FIXED_INTS_32
          A 32 bit signed integer value.
FIXED_INTS_64
          A 64 bit signed integer value.
FIXED_INTS_8
          A 8 bit signed integer value.
FLOAT_32
          A 32 bit floating point value.
FLOAT_64
          A 64 bit floating point value.
VAR_INTS
          A variable bit signed integer value.
 
Method Summary
static DocValues.Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DocValues.Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

VAR_INTS

public static final DocValues.Type VAR_INTS
A variable bit signed integer value. By default this type uses PackedInts to compress the values, as an offset from the minimum value, as long as the value range fits into 263-1. Otherwise, the default implementation falls back to fixed size 64bit integers (FIXED_INTS_64).

NOTE: this type uses 0 as the default value without any distinction between provided 0 values during indexing. All documents without an explicit value will use 0 instead. Custom default values must be assigned explicitly.


FIXED_INTS_8

public static final DocValues.Type FIXED_INTS_8
A 8 bit signed integer value. DocValues.Source instances of this type return a byte array from DocValues.Source.getArray()

NOTE: this type uses 0 as the default value without any distinction between provided 0 values during indexing. All documents without an explicit value will use 0 instead. Custom default values must be assigned explicitly.


FIXED_INTS_16

public static final DocValues.Type FIXED_INTS_16
A 16 bit signed integer value. DocValues.Source instances of this type return a short array from DocValues.Source.getArray()

NOTE: this type uses 0 as the default value without any distinction between provided 0 values during indexing. All documents without an explicit value will use 0 instead. Custom default values must be assigned explicitly.


FIXED_INTS_32

public static final DocValues.Type FIXED_INTS_32
A 32 bit signed integer value. DocValues.Source instances of this type return a int array from DocValues.Source.getArray()

NOTE: this type uses 0 as the default value without any distinction between provided 0 values during indexing. All documents without an explicit value will use 0 instead. Custom default values must be assigned explicitly.


FIXED_INTS_64

public static final DocValues.Type FIXED_INTS_64
A 64 bit signed integer value. DocValues.Source instances of this type return a long array from DocValues.Source.getArray()

NOTE: this type uses 0 as the default value without any distinction between provided 0 values during indexing. All documents without an explicit value will use 0 instead. Custom default values must be assigned explicitly.


FLOAT_32

public static final DocValues.Type FLOAT_32
A 32 bit floating point value. By default there is no compression applied. To fit custom float values into less than 32bit either a custom implementation is needed or values must be encoded into a BYTES_FIXED_STRAIGHT type. DocValues.Source instances of this type return a float array from DocValues.Source.getArray()

NOTE: this type uses 0.0f as the default value without any distinction between provided 0.0f values during indexing. All documents without an explicit value will use 0.0f instead. Custom default values must be assigned explicitly.


FLOAT_64

public static final DocValues.Type FLOAT_64
A 64 bit floating point value. By default there is no compression applied. To fit custom float values into less than 64bit either a custom implementation is needed or values must be encoded into a BYTES_FIXED_STRAIGHT type. DocValues.Source instances of this type return a double array from DocValues.Source.getArray()

NOTE: this type uses 0.0d as the default value without any distinction between provided 0.0d values during indexing. All documents without an explicit value will use 0.0d instead. Custom default values must be assigned explicitly.


BYTES_FIXED_STRAIGHT

public static final DocValues.Type BYTES_FIXED_STRAIGHT
A fixed length straight byte[]. All values added to such a field must be of the same length. All bytes are stored sequentially for fast offset access.

NOTE: this type uses 0 byte filled byte[] based on the length of the first seen value as the default value without any distinction between explicitly provided values during indexing. All documents without an explicit value will use the default instead.Custom default values must be assigned explicitly.


BYTES_FIXED_DEREF

public static final DocValues.Type BYTES_FIXED_DEREF
A fixed length dereferenced byte[] variant. Fields with this type only store distinct byte values and store an additional offset pointer per document to dereference the shared byte[]. Use this type if your documents may share the same byte[].

NOTE: Fields of this type will not store values for documents without an explicitly provided value. If a documents value is accessed while no explicit value is stored the returned BytesRef will be a 0-length reference. Custom default values must be assigned explicitly.


BYTES_VAR_STRAIGHT

public static final DocValues.Type BYTES_VAR_STRAIGHT
Variable length straight stored byte[] variant. All bytes are stored sequentially for compactness. Usage of this type via the disk-resident API might yield performance degradation since no additional index is used to advance by more than one document value at a time.

NOTE: Fields of this type will not store values for documents without an explicitly provided value. If a documents value is accessed while no explicit value is stored the returned BytesRef will be a 0-length byte[] reference. Custom default values must be assigned explicitly.


BYTES_VAR_DEREF

public static final DocValues.Type BYTES_VAR_DEREF
A variable length dereferenced byte[]. Just like BYTES_FIXED_DEREF, but allowing each document's value to be a different length.

NOTE: Fields of this type will not store values for documents without an explicitly provided value. If a documents value is accessed while no explicit value is stored the returned BytesRef will be a 0-length reference. Custom default values must be assigned explicitly.


BYTES_VAR_SORTED

public static final DocValues.Type BYTES_VAR_SORTED
A variable length pre-sorted byte[] variant. Just like BYTES_FIXED_SORTED, but allowing each document's value to be a different length.

NOTE: Fields of this type will not store values for documents without an explicitly provided value. If a documents value is accessed while no explicit value is stored the returned BytesRef will be a 0-length reference.Custom default values must be assigned explicitly.

See Also:
DocValues.SortedSource

BYTES_FIXED_SORTED

public static final DocValues.Type BYTES_FIXED_SORTED
A fixed length pre-sorted byte[] variant. Fields with this type only store distinct byte values and store an additional offset pointer per document to dereference the shared byte[]. The stored byte[] is presorted, by default by unsigned byte order, and allows access via document id, ordinal and by-value. Use this type if your documents may share the same byte[].

NOTE: Fields of this type will not store values for documents without an explicitly provided value. If a documents value is accessed while no explicit value is stored the returned BytesRef will be a 0-length reference. Custom default values must be assigned explicitly.

See Also:
DocValues.SortedSource
Method Detail

values

public static DocValues.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DocValues.Type c : DocValues.Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DocValues.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


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