Class FloatVectorValues

  • Direct Known Subclasses:
    VectorValues

    public abstract class FloatVectorValues
    extends DocIdSetIterator
    This class provides access to per-document floating point vector values indexed as KnnFloatVectorField.
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Field Detail

      • MAX_DIMENSIONS

        public static final int MAX_DIMENSIONS
        The maximum length of a vector
        See Also:
        Constant Field Values
    • Constructor Detail

      • FloatVectorValues

        protected FloatVectorValues()
        Sole constructor
    • Method Detail

      • dimension

        public abstract int dimension()
        Return the dimension of the vectors
      • size

        public abstract int size()
        Return the number of vectors for this field.
        Returns:
        the number of vectors returned by this iterator
      • cost

        public final long cost()
        Description copied from class: DocIdSetIterator
        Returns the estimated cost of this DocIdSetIterator.

        This is generally an upper bound of the number of documents this iterator might match, but may be a rough heuristic, hardcoded value, or otherwise completely inaccurate.

        Specified by:
        cost in class DocIdSetIterator
      • vectorValue

        public abstract float[] vectorValue()
                                     throws IOException
        Return the vector value for the current document ID. It is illegal to call this method when the iterator is not positioned: before advancing, or after failing to advance. The returned array may be shared across calls, re-used, and modified as the iterator advances.
        Returns:
        the vector value
        Throws:
        IOException