Class PerFieldKnnVectorsFormat.FieldsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.KnnVectorsWriter
-
- org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat.FieldsWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Enclosing class:
- PerFieldKnnVectorsFormat
private class PerFieldKnnVectorsFormat.FieldsWriter extends KnnVectorsWriter
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<KnnVectorsFormat,PerFieldKnnVectorsFormat.WriterAndSuffix>
formats
private SegmentWriteState
segmentWriteState
private java.util.Map<java.lang.String,java.lang.Integer>
suffixes
-
Constructor Summary
Constructors Constructor Description FieldsWriter(SegmentWriteState segmentWriteState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
finish()
Called once at the end before closeprivate KnnVectorsWriter
getInstance(FieldInfo field)
void
merge(MergeState mergeState)
Merges the segment vectors for all fields.void
writeField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader)
Write all values contained in the provided reader
-
-
-
Field Detail
-
formats
private final java.util.Map<KnnVectorsFormat,PerFieldKnnVectorsFormat.WriterAndSuffix> formats
-
suffixes
private final java.util.Map<java.lang.String,java.lang.Integer> suffixes
-
segmentWriteState
private final SegmentWriteState segmentWriteState
-
-
Constructor Detail
-
FieldsWriter
FieldsWriter(SegmentWriteState segmentWriteState)
-
-
Method Detail
-
writeField
public void writeField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader) throws java.io.IOException
Description copied from class:KnnVectorsWriter
Write all values contained in the provided reader- Specified by:
writeField
in classKnnVectorsWriter
- Throws:
java.io.IOException
-
merge
public final void merge(MergeState mergeState) throws java.io.IOException
Description copied from class:KnnVectorsWriter
Merges the segment vectors for all fields. This default implementation delegates toKnnVectorsWriter.writeField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.KnnVectorsReader)
, passing aKnnVectorsReader
that combines the vector values and ignores deleted documents.- Overrides:
merge
in classKnnVectorsWriter
- Throws:
java.io.IOException
-
finish
public void finish() throws java.io.IOException
Description copied from class:KnnVectorsWriter
Called once at the end before close- Specified by:
finish
in classKnnVectorsWriter
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
getInstance
private KnnVectorsWriter getInstance(FieldInfo field) throws java.io.IOException
- Throws:
java.io.IOException
-
-