public class SimpleTextTermVectorsWriter extends TermVectorsWriter
FOR RECREATIONAL USE ONLY
| Constructor and Description |
|---|
SimpleTextTermVectorsWriter(Directory directory,
java.lang.String segment,
IOContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPosition(int position,
int startOffset,
int endOffset,
BytesRef payload)
Adds a term position and offsets
|
void |
close() |
void |
finish(FieldInfos fis,
int numDocs)
Called before
TermVectorsWriter.close(), passing in the number
of documents that were written. |
void |
startDocument(int numVectorFields)
Called before writing the term vectors of the document.
|
void |
startField(FieldInfo info,
int numTerms,
boolean positions,
boolean offsets,
boolean payloads)
Called before writing the terms of the field.
|
void |
startTerm(BytesRef term,
int freq)
Adds a term and its term frequency
freq. |
addAllDocVectors, addProx, finishDocument, finishField, finishTerm, mergepublic void startDocument(int numVectorFields)
throws java.io.IOException
TermVectorsWriterTermVectorsWriter.startField(FieldInfo, int, boolean, boolean, boolean) will
be called numVectorFields times. Note that if term
vectors are enabled, this is called even if the document
has no vector fields, in this case numVectorFields
will be zero.startDocument in class TermVectorsWriterjava.io.IOExceptionpublic void startField(FieldInfo info, int numTerms, boolean positions, boolean offsets, boolean payloads) throws java.io.IOException
TermVectorsWriterTermVectorsWriter.startTerm(BytesRef, int) will be called numTerms times.startField in class TermVectorsWriterjava.io.IOExceptionpublic void startTerm(BytesRef term, int freq) throws java.io.IOException
TermVectorsWriterfreq.
If this field has positions and/or offsets enabled, then
TermVectorsWriter.addPosition(int, int, int, BytesRef) will be called
freq times respectively.startTerm in class TermVectorsWriterjava.io.IOExceptionpublic void addPosition(int position,
int startOffset,
int endOffset,
BytesRef payload)
throws java.io.IOException
TermVectorsWriteraddPosition in class TermVectorsWriterjava.io.IOExceptionpublic void finish(FieldInfos fis, int numDocs) throws java.io.IOException
TermVectorsWriterTermVectorsWriter.close(), passing in the number
of documents that were written. Note that this is
intentionally redundant (equivalent to the number of
calls to TermVectorsWriter.startDocument(int), but a Codec should
check that this is the case to detect the JRE bug described
in LUCENE-1282.finish in class TermVectorsWriterjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class TermVectorsWriterjava.io.IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.