Class SimpleTextKnnVectorsWriter
java.lang.Object
org.apache.lucene.codecs.KnnVectorsWriter
org.apache.lucene.codecs.simpletext.SimpleTextKnnVectorsWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
Writes vector-valued fields in a plain text format
-
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 IndexOutput -
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) voidwriteField(FieldInfo fieldInfo, KnnVectorsReader knnVectorsReader) Write all values contained in the provided readerprivate voidwriteField(IndexOutput out, BytesRef fieldName, int value) private voidwriteField(IndexOutput out, BytesRef fieldName, long value) private voidwriteField(IndexOutput out, BytesRef fieldName, String value) private voidwriteInt(IndexOutput out, int x) private voidwriteLong(IndexOutput out, long x) private voidprivate voidwriteVectorValue(VectorValues vectors) Methods inherited from class org.apache.lucene.codecs.KnnVectorsWriter
merge
-
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
Description copied from class:KnnVectorsWriterWrite all values contained in the provided reader- Specified by:
writeFieldin classKnnVectorsWriter- Throws:
IOException
-
writeVectorValue
- 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
-