Class Lucene99FlatVectorsReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Accountable

    public final class Lucene99FlatVectorsReader
    extends FlatVectorsReader
    Reads vectors from the index segments.
    • Constructor Detail

      • Lucene99FlatVectorsReader

        Lucene99FlatVectorsReader​(SegmentReadState state)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • readMetadata

        private int readMetadata​(SegmentReadState state)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • openDataInput

        private static IndexInput openDataInput​(SegmentReadState state,
                                                int versionMeta,
                                                java.lang.String fileExtension,
                                                java.lang.String codecName)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readFields

        private void readFields​(ChecksumIndexInput meta,
                                FieldInfos infos)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readVectorEncoding

        private VectorEncoding readVectorEncoding​(DataInput input)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
      • checkIntegrity

        public void checkIntegrity()
                            throws java.io.IOException
        Description copied from class: FlatVectorsReader
        Checks consistency of this reader.

        Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.

        Specified by:
        checkIntegrity in class FlatVectorsReader
        Throws:
        java.io.IOException
      • getRandomVectorScorer

        public RandomVectorScorer getRandomVectorScorer​(java.lang.String field,
                                                        float[] target)
                                                 throws java.io.IOException
        Description copied from class: FlatVectorsReader
        Returns a RandomVectorScorer for the given field and target vector.
        Specified by:
        getRandomVectorScorer in class FlatVectorsReader
        Parameters:
        field - the field to search
        target - the target vector
        Returns:
        a RandomVectorScorer for the given field and target vector.
        Throws:
        java.io.IOException - if an I/O error occurs when reading from the index.
      • getRandomVectorScorer

        public RandomVectorScorer getRandomVectorScorer​(java.lang.String field,
                                                        byte[] target)
                                                 throws java.io.IOException
        Description copied from class: FlatVectorsReader
        Returns a RandomVectorScorer for the given field and target vector.
        Specified by:
        getRandomVectorScorer in class FlatVectorsReader
        Parameters:
        field - the field to search
        target - the target vector
        Returns:
        a RandomVectorScorer for the given field and target vector.
        Throws:
        java.io.IOException - if an I/O error occurs when reading from the index.
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException