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>formatsprivate SegmentWriteStatesegmentWriteStateprivate 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 voidclose()voidfinish()Called once at the end before closeprivate KnnVectorsWritergetInstance(FieldInfo field)voidmerge(MergeState mergeState)Merges the segment vectors for all fields.voidwriteField(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:KnnVectorsWriterWrite all values contained in the provided reader- Specified by:
writeFieldin classKnnVectorsWriter- Throws:
java.io.IOException
-
merge
public final void merge(MergeState mergeState) throws java.io.IOException
Description copied from class:KnnVectorsWriterMerges the segment vectors for all fields. This default implementation delegates toKnnVectorsWriter.writeField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.KnnVectorsReader), passing aKnnVectorsReaderthat combines the vector values and ignores deleted documents.- Overrides:
mergein classKnnVectorsWriter- Throws:
java.io.IOException
-
finish
public void finish() throws java.io.IOExceptionDescription copied from class:KnnVectorsWriterCalled once at the end before close- Specified by:
finishin 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
-
-