|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.codecs.TermVectorsWriter
org.apache.lucene.codecs.simpletext.SimpleTextTermVectorsWriter
public class SimpleTextTermVectorsWriter
Writes plain-text term vectors.
FOR RECREATIONAL USE ONLY
Constructor Summary | |
---|---|
SimpleTextTermVectorsWriter(Directory directory,
String segment,
IOContext context)
|
Method Summary | |
---|---|
void |
abort()
Aborts writing entirely, implementation should remove any partially-written files, etc. |
void |
addPosition(int position,
int startOffset,
int endOffset)
Adds a term position and offsets |
void |
close()
|
void |
finish(FieldInfos fis,
int numDocs)
Called before Closeable.close() , passing in the number
of documents that were written. |
Comparator<BytesRef> |
getComparator()
Return the BytesRef Comparator used to sort terms before feeding to this API. |
void |
startDocument(int numVectorFields)
Called before writing the term vectors of the document. |
void |
startField(FieldInfo info,
int numTerms,
boolean positions,
boolean offsets)
Called before writing the terms of the field. |
void |
startTerm(BytesRef term,
int freq)
Adds a term and its term frequency freq . |
Methods inherited from class org.apache.lucene.codecs.TermVectorsWriter |
---|
addAllDocVectors, addProx, merge |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleTextTermVectorsWriter(Directory directory, String segment, IOContext context) throws IOException
IOException
Method Detail |
---|
public void startDocument(int numVectorFields) throws IOException
TermVectorsWriter
TermVectorsWriter.startField(FieldInfo, int, 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 TermVectorsWriter
IOException
public void startField(FieldInfo info, int numTerms, boolean positions, boolean offsets) throws IOException
TermVectorsWriter
TermVectorsWriter.startTerm(BytesRef, int)
will be called numTerms
times.
startField
in class TermVectorsWriter
IOException
public void startTerm(BytesRef term, int freq) throws IOException
TermVectorsWriter
freq
.
If this field has positions and/or offsets enabled, then
TermVectorsWriter.addPosition(int, int, int)
will be called
freq
times respectively.
startTerm
in class TermVectorsWriter
IOException
public void addPosition(int position, int startOffset, int endOffset) throws IOException
TermVectorsWriter
addPosition
in class TermVectorsWriter
IOException
public void abort()
TermVectorsWriter
abort
in class TermVectorsWriter
public void finish(FieldInfos fis, int numDocs) throws IOException
TermVectorsWriter
Closeable.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 TermVectorsWriter
IOException
public void close() throws IOException
IOException
public Comparator<BytesRef> getComparator() throws IOException
TermVectorsWriter
getComparator
in class TermVectorsWriter
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |