FloatAssociationFacetField (Lucene 10.5.1 facet API)
Description: declaration: package: org.apache.lucene.facet.taxonomy, class: FloatAssociationFacetField

Package org.apache.lucene.facet.taxonomy

# Class FloatAssociationFacetField

java.lang.Object
org.apache.lucene.document.Field
org.apache.lucene.facet.taxonomy.AssociationFacetField
org.apache.lucene.facet.taxonomy.FloatAssociationFacetField

All Implemented Interfaces:
  `IndexableField`

public class FloatAssociationFacetField extends AssociationFacetField
Add an instance of this to your `Document` to add a facet label associated with a float. Use `TaxonomyFacetFloatAssociations` to aggregate float values per facet label at search time.

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

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.lucene.document.Field

  `Field.Store`

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.facet.taxonomy.AssociationFacetField

  `assoc, dim, path, TYPE`

  ### Fields inherited from class org.apache.lucene.document.Field

  `fieldsData, name, type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FloatAssociationFacetField(float assoc, String dim, String... path)`
  Creates this from `dim` and `path` and a float association

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static float`
  `bytesRefToFloat(BytesRef b)`
  Decodes a previously encoded `float`.
  `static BytesRef`
  `floatToBytesRef(float v)`
  Encodes a `float` as a 4-byte `BytesRef`.
  `String`
  `toString()`

  ### Methods inherited from class org.apache.lucene.document.Field

  `binaryValue, fieldType, getCharSequenceValue, invertableType, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, storedValue, stringValue, tokenStream, tokenStreamValue`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### FloatAssociationFacetField

    public FloatAssociationFacetField(float assoc, String dim, String... path)
    Creates this from `dim` and `path` and a float association

- ## Method Details

  - ### floatToBytesRef

    public static BytesRef floatToBytesRef(float v)
    Encodes a `float` as a 4-byte `BytesRef`.

  - ### bytesRefToFloat

    public static float bytesRefToFloat(BytesRef b)
    Decodes a previously encoded `float`.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `AssociationFacetField`