OffHeapFloatVectorValues (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.codecs.lucene95, class: OffHeapFloatVectorValues

Package org.apache.lucene.codecs.lucene95

# Class OffHeapFloatVectorValues

java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.FloatVectorValues
org.apache.lucene.codecs.lucene95.OffHeapFloatVectorValues

All Implemented Interfaces:
  `HasIndexSlice`

Direct Known Subclasses:
  `OffHeapFloatVectorValues.DenseOffHeapVectorValues`

public abstract class OffHeapFloatVectorValues extends FloatVectorValues implements HasIndexSlice
Read the vector values from the index input. This supports both iterated and random access.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `OffHeapFloatVectorValues.DenseOffHeapVectorValues`
  Dense vector values that are stored off-heap.

  ## Nested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues

  `KnnVectorValues.DocIndexIterator`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final int`
  `byteSize`
  `protected final int`
  `dimension`
  `protected final FlatVectorsScorer`
  `flatVectorsScorer`
  `protected int`
  `lastOrd`
  `protected final VectorSimilarityFunction`
  `similarityFunction`
  `protected final int`
  `size`
  `protected final IndexInput`
  `slice`
  `protected final float[]`
  `value`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `dimension()`
  Return the dimension of the vectors
  `IndexInput`
  `getSlice()`
  Returns an IndexInput from which to read this instance's values, or null if not available.
  `static OffHeapFloatVectorValues`
  `load(VectorSimilarityFunction vectorSimilarityFunction, FlatVectorsScorer flatVectorsScorer, OrdToDocDISIReaderConfiguration configuration, VectorEncoding vectorEncoding, int dimension, long vectorDataOffset, long vectorDataLength, IndexInput vectorData)`
  `void`
  `prefetch(int[] ordsToPrefetch, int numOrds)`
  Prefetches the provided ordinals
  `int`
  `size()`
  Return the number of vectors for this field.
  `float[]`
  `vectorValue(int targetOrd)`
  Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown.

  ### Methods inherited from class org.apache.lucene.index.FloatVectorValues

  `checkField, copy, fromFloats, getEncoding, rescorer, scorer`

  ### Methods inherited from class org.apache.lucene.index.KnnVectorValues

  `createDenseIterator, createSparseIterator, fromDISI, getAcceptOrds, getVectorByteLength, iterator, ordToDoc`

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

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

- ## Field Details

  - ### dimension

    protected final int dimension

  - ### size

    protected final int size

  - ### slice

    protected final IndexInput slice

  - ### byteSize

    protected final int byteSize

  - ### lastOrd

    protected int lastOrd

  - ### value

    protected final float[] value

  - ### similarityFunction

    protected final VectorSimilarityFunction similarityFunction

  - ### flatVectorsScorer

    protected final FlatVectorsScorer flatVectorsScorer

- ## Method Details

  - ### dimension

    public int dimension()
    Description copied from class: `KnnVectorValues`
    Return the dimension of the vectors
    Specified by:
      `dimension` in class `KnnVectorValues`

  - ### size

    public int size()
    Description copied from class: `KnnVectorValues`
    Return the number of vectors for this field.
    Specified by:
      `size` in class `KnnVectorValues`
    Returns:
      the number of vectors returned by this iterator

  - ### getSlice

    public IndexInput getSlice()
    Description copied from interface: `HasIndexSlice`
    Returns an IndexInput from which to read this instance's values, or null if not available.
    Specified by:
      `getSlice` in interface `HasIndexSlice`

  - ### vectorValue

    public float[] vectorValue(int targetOrd) throws IOException
    Description copied from class: `FloatVectorValues`
    Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown. The returned array may be shared across calls.
    Specified by:
      `vectorValue` in class `FloatVectorValues`
    Returns:
      the vector value
    Throws:
      `IOException`

  - ### prefetch

    public void prefetch(int[] ordsToPrefetch, int numOrds) throws IOException
    Description copied from class: `KnnVectorValues`
    Prefetches the provided ordinals
    Overrides:
      `prefetch` in class `KnnVectorValues`
    Parameters:
      `ordsToPrefetch` - a list of ordinals to prefetch
      `numOrds` - number of ords to prefetch from ordsToPrefetch array
    Throws:
      `IOException`

  - ### load

    public static OffHeapFloatVectorValues load(VectorSimilarityFunction vectorSimilarityFunction, FlatVectorsScorer flatVectorsScorer, OrdToDocDISIReaderConfiguration configuration, VectorEncoding vectorEncoding, int dimension, long vectorDataOffset, long vectorDataLength, IndexInput vectorData) throws IOException
    Throws:
      `IOException`