Interface RandomAccessVectorValues<T>

  • public interface RandomAccessVectorValues<T>
    Provides random access to vectors by dense ordinal. This interface is used by HNSW-based implementations of KNN search.
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Method Detail

      • size

        int size()
        Return the number of vector values
      • dimension

        int dimension()
        Return the dimension of the returned vector values
      • vectorValue

        T vectorValue​(int targetOrd)
               throws IOException
        Return the vector value indexed at the given ordinal.
        targetOrd - a valid ordinal, ≥ 0 and < size().
      • ordToDoc

        default int ordToDoc​(int ord)
        Translates vector ordinal to the correct document ID. By default, this is an identity function.
        ord - the vector ordinal
        the document Id for that vector ordinal