Class VectorValues

    • Field Detail

      • MAX_DIMENSIONS

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

        public static final VectorValues EMPTY
        Represents the lack of vector values. It is returned by providers that do not support VectorValues.
    • Constructor Detail

      • VectorValues

        protected VectorValues()
        Sole constructor
    • Method Detail

      • dimension

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

        public abstract int size()
        TODO: should we use cost() for this? We rely on its always being exactly the number of documents having a value for this field, which is not guaranteed by the cost() contract, but in all the implementations so far they are the same.
        Returns:
        the number of vectors returned by this iterator
      • 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
      • binaryValue

        public BytesRef binaryValue()
                             throws IOException
        Return the binary encoded vector value for the current document ID. These are the bytes corresponding to the float array return by vectorValue(). It is illegal to call this method when the iterator is not positioned: before advancing, or after failing to advance. The returned storage may be shared across calls, re-used and modified as the iterator advances.
        Returns:
        the binary value
        Throws:
        IOException