Interface VectorValues

All Known Subinterfaces:
VectorValues.MultiIndexVectorValues, VectorValues.SingleVectorValues

@Beta public interface VectorValues
A VectorValues instance contains the vectors that describe a VectorDocument. VectorValues may come in different forms:
  • When a single vector index is defined in a VectorCollection, then a plain float[] can be used, as defined in VectorValues.SingleVectorValues
  • When more than one vector index is defined, then the vector representation of a VectorDocument requires a mapping from index name to the associated float[] vector
  • .
Since:
5.5
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Provides a mapping from index name to vector, supplying vectors for a VectorCollection with multiple indexes defined.
    static interface 
    Represents values of a single vector.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    of(float[] vector)
    Returns a VectorValues object suitable for supplying a single vector to a VectorCollection configured with one vector index.
    of(String indexName, float[] vector)
    Returns a VectorValues object that represents a single named vector.
    of(String indexName1, float[] vector1, String indexName2, float[] vector2)
    Returns a VectorValues object that represents two mappings of index names to associated vectors.
    of(Map<String,float[]> indexNameToVector)
    Returns a VectorValues object that represents the given mappings of index names to associated vectors.
  • Method Details

    • of

      static VectorValues of(float[] vector)
      Returns a VectorValues object suitable for supplying a single vector to a VectorCollection configured with one vector index.
      Parameters:
      vector - the vector
      Returns:
      a VectorValues object representing the given vector
    • of

      static VectorValues of(String indexName, float[] vector)
      Returns a VectorValues object that represents a single named vector.
      Parameters:
      indexName - the index name
      vector - the vector
      Returns:
      a VectorValues representing the given vector with name.
    • of

      static VectorValues of(String indexName1, float[] vector1, String indexName2, float[] vector2)
      Returns a VectorValues object that represents two mappings of index names to associated vectors.
      Parameters:
      indexName1 - the first mapping's index name
      vector1 - the first mapping's vector
      indexName2 - the second mapping's index name
      vector2 - the second mapping's vector
      Returns:
      a VectorValues object with two index name to vector mappings.
    • of

      static VectorValues of(Map<String,float[]> indexNameToVector)
      Returns a VectorValues object that represents the given mappings of index names to associated vectors.
      Parameters:
      indexNameToVector - the index name to vector mappings
      Returns:
      a VectorValues object populated with the given mappings.