CLucene - a full-featured, c++ search engine
API Documentation
#include <TermVector.h>

Classes | |
| class | TVField |
| class | TVTerm |
Public Member Functions | |
| LUCENE_STATIC_CONSTANT (int32_t, FORMAT_VERSION=2) | |
| LUCENE_STATIC_CONSTANT (int32_t, FORMAT_SIZE=4) | |
| LUCENE_STATIC_CONSTANT (uint8_t, STORE_POSITIONS_WITH_TERMVECTOR=0x1) | |
| LUCENE_STATIC_CONSTANT (uint8_t, STORE_OFFSET_WITH_TERMVECTOR=0x2) | |
| TermVectorsWriter (lucene::store::Directory *directory, const char *segment, FieldInfos *fieldInfos) | |
| ~TermVectorsWriter () | |
| void | openDocument () |
| void | closeDocument () |
| void | close () |
| Close all streams. | |
| bool | isDocumentOpen () const |
| void | openField (const TCHAR *field) |
| Start processing a field. | |
| void | closeField () |
| Finished processing current field. | |
| bool | isFieldOpen () const |
| Return true if a field is currently open. | |
| void | addAllDocVectors (Array< TermFreqVector * > &vectors) |
| Add a complete document specified by all its term vectors. | |
| void | addTerm (const TCHAR *termText, int32_t freq, Array< int32_t > *positions=NULL, Array< TermVectorOffsetInfo > *offsets=NULL) |
| Add term to the field's term vector. | |
Static Public Attributes | |
| static const char * | LUCENE_TVX_EXTENSION |
| static const char * | LUCENE_TVD_EXTENSION |
| static const char * | LUCENE_TVF_EXTENSION |
Rough usage:
for each document { writer.openDocument(); for each field on the document { writer.openField(field); for all of the terms { writer.addTerm(...) } writer.closeField } writer.closeDocument() }
| lucene::index::TermVectorsWriter::TermVectorsWriter | ( | lucene::store::Directory * | directory, | |
| const char * | segment, | |||
| FieldInfos * | fieldInfos | |||
| ) |
| lucene::index::TermVectorsWriter::~TermVectorsWriter | ( | ) |
| void lucene::index::TermVectorsWriter::addAllDocVectors | ( | Array< TermFreqVector * > & | vectors | ) |
| void lucene::index::TermVectorsWriter::addTerm | ( | const TCHAR * | termText, | |
| int32_t | freq, | |||
| Array< int32_t > * | positions = NULL, |
|||
| Array< TermVectorOffsetInfo > * | offsets = NULL | |||
| ) |
Add term to the field's term vector.
Field must already be open. Terms should be added in increasing order of terms, one call per unique termNum. ProxPointer is a pointer into the TermPosition file (prx). Freq is the number of times this term appears in this field, in this document.
| IllegalStateException | if document or field is not open |
| void lucene::index::TermVectorsWriter::close | ( | ) |
Close all streams.
| void lucene::index::TermVectorsWriter::closeDocument | ( | ) |
| void lucene::index::TermVectorsWriter::closeField | ( | ) |
Finished processing current field.
This should be followed by a call to openField before future calls to addTerm.
| bool lucene::index::TermVectorsWriter::isDocumentOpen | ( | ) | const |
| bool lucene::index::TermVectorsWriter::isFieldOpen | ( | ) | const |
Return true if a field is currently open.
| lucene::index::TermVectorsWriter::LUCENE_STATIC_CONSTANT | ( | uint8_t | , | |
| STORE_OFFSET_WITH_TERMVECTOR | = 0x2 | |||
| ) |
| lucene::index::TermVectorsWriter::LUCENE_STATIC_CONSTANT | ( | uint8_t | , | |
| STORE_POSITIONS_WITH_TERMVECTOR | = 0x1 | |||
| ) |
| lucene::index::TermVectorsWriter::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
| FORMAT_SIZE | = 4 | |||
| ) |
| lucene::index::TermVectorsWriter::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
| FORMAT_VERSION | = 2 | |||
| ) |
| void lucene::index::TermVectorsWriter::openDocument | ( | ) |
| void lucene::index::TermVectorsWriter::openField | ( | const TCHAR * | field | ) |
Start processing a field.
This can be followed by a number of calls to addTerm, and a final call to closeField to indicate the end of processing of this field. If a field was previously open, it is closed automatically.
const char* lucene::index::TermVectorsWriter::LUCENE_TVD_EXTENSION [static] |
const char* lucene::index::TermVectorsWriter::LUCENE_TVF_EXTENSION [static] |
const char* lucene::index::TermVectorsWriter::LUCENE_TVX_EXTENSION [static] |