Class FlatVectorsWriter

    • Constructor Detail

      • FlatVectorsWriter

        protected FlatVectorsWriter()
        Sole constructor
    • Method Detail

      • addField

        public abstract FlatFieldVectorsWriter<?> addField​(FieldInfo fieldInfo,
                                                           KnnFieldVectorsWriter<?> indexWriter)
                                                    throws IOException
        Add a new field for indexing, allowing the user to provide a writer that the flat vectors writer can delegate to if additional indexing logic is required.
        Parameters:
        fieldInfo - fieldInfo of the field to add
        indexWriter - the writer to delegate to, can be null
        Returns:
        a writer for the field
        Throws:
        IOException - if an I/O error occurs when adding the field
      • mergeOneFieldToIndex

        public abstract CloseableRandomVectorScorerSupplier mergeOneFieldToIndex​(FieldInfo fieldInfo,
                                                                                 MergeState mergeState)
                                                                          throws IOException
        Write the field for merging, providing a scorer over the newly merged flat vectors. This way any additional merging logic can be implemented by the user of this class.
        Parameters:
        fieldInfo - fieldInfo of the field to merge
        mergeState - mergeState of the segments to merge
        Returns:
        a scorer over the newly merged flat vectors, which should be closed as it holds a temporary file handle to read over the newly merged vectors
        Throws:
        IOException - if an I/O error occurs when merging
      • finish

        public abstract void finish()
                             throws IOException
        Called once at the end before close
        Throws:
        IOException