Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.document
Class FloatDocValuesField

    java.lang.Object
      org.apache.lucene.document.Field
          org.apache.lucene.document.NumericDocValuesField
              org.apache.lucene.document.FloatDocValuesField

All Implemented Interfaces:
  IndexableField

    public class FloatDocValuesField

extends NumericDocValuesField

Syntactic sugar for encoding floats as NumericDocValues via `Float.floatToRawIntBits(float)`.

Per-document floating point values can be retrieved via `FieldCache.getFloats(AtomicReader, String, boolean)`.

NOTE: In most all cases this will be rather inefficient, requiring four bytes per document. Consider encoding floating point values yourself with only as much precision as you require.

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.lucene.document.Field
`Field.Index, Field.Store, Field.TermVector`

Field Summary

Fields inherited from class org.apache.lucene.document.NumericDocValuesField
`TYPE`

Fields inherited from class org.apache.lucene.document.Field
`boost, fieldsData, name, tokenStream, type`

Constructor Summary
`FloatDocValuesField(String name, float value)` Creates a new DocValues field with the specified 32-bit float value

Method Summary
`void` | `setFloatValue(float value)` Expert: change the value of this field.
`void` | `setLongValue(long value)` Expert: change the value of this field.

Methods inherited from class org.apache.lucene.document.Field
`binaryValue, boost, fieldType, name, numericValue, readerValue, setBoost, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setIntValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString, translateFieldType`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### FloatDocValuesField

    public FloatDocValuesField(String name,
                               float value)

  Creates a new DocValues field with the specified 32-bit float value

  Parameters:
    `name` - field name
    `value` - 32-bit float value
  Throws:
    `IllegalArgumentException` - if the field name is null

Method Detail

### setFloatValue

    public void setFloatValue(float value)

  Description copied from class: `Field`
  Expert: change the value of this field. See `Field.setStringValue(String)`.

  Overrides:
    `setFloatValue` in class `Field`

### setLongValue

    public void setLongValue(long value)

  Description copied from class: `Field`
  Expert: change the value of this field. See `Field.setStringValue(String)`.

  Overrides:
    `setLongValue` in class `Field`

Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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