Module org.apache.lucene.codecs
Class SimpleTextKnnVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.BufferingKnnVectorsWriter
org.apache.lucene.codecs.simpletext.SimpleTextKnnVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable
Writes vector-valued fields in a plain text format
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.codecs.KnnVectorsWriter
KnnVectorsWriter.MergedVectorValues -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final BytesRef(package private) static final BytesRefprivate final IndexOutputprivate final BytesRefBuilder(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRef(package private) static final BytesRefprivate final IndexOutputFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidfinish()Called once at the end before closeprivate voidnewline(IndexOutput out) private voidwrite(IndexOutput out, String s) private voidwrite(IndexOutput out, BytesRef b) private voidwriteByteVectorValue(ByteVectorValues vectors) voidwriteField(FieldInfo fieldInfo, ByteVectorValues byteVectorValues, int maxDoc) Write the provided byte vector fieldvoidwriteField(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, int maxDoc) Write the provided float vector fieldprivate voidwriteField(IndexOutput out, BytesRef fieldName, int value) private voidwriteField(IndexOutput out, BytesRef fieldName, long value) private voidwriteField(IndexOutput out, BytesRef fieldName, String value) private voidwriteFloatVectorValue(FloatVectorValues vectors) private voidwriteInt(IndexOutput out, int x) private voidwriteLong(IndexOutput out, long x) private voidMethods inherited from class org.apache.lucene.codecs.BufferingKnnVectorsWriter
addField, flush, mergeOneField, ramBytesUsedMethods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
mergeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
FIELD_NUMBER
-
FIELD_NAME
-
VECTOR_DATA_OFFSET
-
VECTOR_DATA_LENGTH
-
VECTOR_DIMENSION
-
SIZE
-
meta
-
vectorData
-
scratch
-
-
Constructor Details
-
SimpleTextKnnVectorsWriter
SimpleTextKnnVectorsWriter(SegmentWriteState state) throws IOException - Throws:
IOException
-
-
Method Details
-
writeField
public void writeField(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, int maxDoc) throws IOException Description copied from class:BufferingKnnVectorsWriterWrite the provided float vector field- Specified by:
writeFieldin classBufferingKnnVectorsWriter- Throws:
IOException
-
writeFloatVectorValue
- Throws:
IOException
-
writeField
public void writeField(FieldInfo fieldInfo, ByteVectorValues byteVectorValues, int maxDoc) throws IOException Description copied from class:BufferingKnnVectorsWriterWrite the provided byte vector field- Specified by:
writeFieldin classBufferingKnnVectorsWriter- Throws:
IOException
-
writeByteVectorValue
- Throws:
IOException
-
writeMeta
private void writeMeta(FieldInfo field, long vectorDataOffset, long vectorDataLength, List<Integer> docIds) throws IOException - Throws:
IOException
-
finish
Description copied from class:KnnVectorsWriterCalled once at the end before close- Specified by:
finishin classKnnVectorsWriter- Throws:
IOException
-
close
- Throws:
IOException
-
writeField
- Throws:
IOException
-
writeField
- Throws:
IOException
-
writeField
- Throws:
IOException
-
write
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
writeLong
- Throws:
IOException
-
write
- Throws:
IOException
-
newline
- Throws:
IOException
-