Lucene++ - a full-featured, c++ search engine
API Documentation

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

TermInfosWriter.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6
7 #ifndef TERMINFOSWRITER_H
8 #define TERMINFOSWRITER_H
9
10 #include "LuceneObject.h"
11
12 namespace Lucene {
13
16 class TermInfosWriter : public LuceneObject {
17 public:
18 TermInfosWriter(const DirectoryPtr& directory, const String& segment, const FieldInfosPtr& fis, int32_t interval);
19 TermInfosWriter(const DirectoryPtr& directory, const String& segment, const FieldInfosPtr& fis, int32_t interval, bool isIndex);
20 virtual ~TermInfosWriter();
21
22 LUCENE_CLASS(TermInfosWriter);
23
24 public:
26 static const int32_t FORMAT;
27
29 static const int32_t FORMAT_VERSION_UTF8_LENGTH_IN_BYTES;
30
32 static const int32_t FORMAT_CURRENT;
33
37 int32_t indexInterval;
38
43 int32_t skipInterval;
44
47 int32_t maxSkipLevels;
48
49 protected:
50 FieldInfosPtr fieldInfos;
51 IndexOutputPtr output;
52 TermInfoPtr lastTi;
53 int64_t size;
54
55 int64_t lastIndexPointer;
56 bool isIndex;
57 ByteArray lastTermBytes;
58 int32_t lastTermBytesLength;
59 int32_t lastFieldNumber;
60
61 TermInfosWriterPtr otherWriter;
62 TermInfosWriterWeakPtr _other;
63 UTF8ResultPtr utf8Result;
64
65 // Currently used only by assert statements
66 UnicodeResultPtr unicodeResult1;
67 UnicodeResultPtr unicodeResult2;
68
69 public:
70 virtual void initialize();
71
72 void add(const TermPtr& term, const TermInfoPtr& ti);
73
76 void add(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength, const TermInfoPtr& ti);
77
79 void close();
80
81 protected:
82 void initialize(const DirectoryPtr& directory, const String& segment, const FieldInfosPtr& fis, int32_t interval, bool isi);
83
85 bool initUnicodeResults();
86
88 int32_t compareToLastTerm(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength);
89
90 void writeTerm(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength);
91 };
92
93 }
94
95 #endif
Lucene::TermInfosWriter::lastIndexPointer
int64_t lastIndexPointer
Definition: TermInfosWriter.h:55
Lucene::UTF8ResultPtr
boost::shared_ptr< UTF8Result > UTF8ResultPtr
Definition: LuceneTypes.h:559
Lucene::TermInfosWriterWeakPtr
boost::weak_ptr< TermInfosWriter > TermInfosWriterWeakPtr
Definition: LuceneTypes.h:242
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
Lucene::IndexOutputPtr
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition: LuceneTypes.h:494
Lucene::TermInfosWriter::add
void add(const TermPtr &term, const TermInfoPtr &ti)
Lucene::TermInfosWriter::lastTermBytes
ByteArray lastTermBytes
Definition: TermInfosWriter.h:57
Lucene::TermInfosWriter::FORMAT_CURRENT
static const int32_t FORMAT_CURRENT
NOTE: always change this if you switch to a new format.
Definition: TermInfosWriter.h:32
Lucene::TermInfosWriter::initialize
virtual void initialize()
Called directly after instantiation to create objects that depend on this object being fully construc...
Lucene::TermInfosWriter::maxSkipLevels
int32_t maxSkipLevels
The maximum number of skip levels. Smaller values result in slightly smaller indexes, but slower skipping in big posting lists.
Definition: TermInfosWriter.h:47
Lucene::TermInfosWriter::lastTermBytesLength
int32_t lastTermBytesLength
Definition: TermInfosWriter.h:58
LuceneObject.h
Lucene::TermInfosWriter::FORMAT_VERSION_UTF8_LENGTH_IN_BYTES
static const int32_t FORMAT_VERSION_UTF8_LENGTH_IN_BYTES
Changed strings to true utf8 with length-in-bytes not length-in-chars.
Definition: TermInfosWriter.h:29
Lucene::TermInfosWriter::isIndex
bool isIndex
Definition: TermInfosWriter.h:56
Lucene::UnicodeResultPtr
boost::shared_ptr< UnicodeResult > UnicodeResultPtr
Definition: LuceneTypes.h:554
Lucene::TermInfosWriter::fieldInfos
FieldInfosPtr fieldInfos
Definition: TermInfosWriter.h:50
Lucene::TermInfosWriter::FORMAT
static const int32_t FORMAT
The file format version, a negative number.
Definition: TermInfosWriter.h:22
Lucene::TermInfosWriter::~TermInfosWriter
virtual ~TermInfosWriter()
Lucene::TermInfosWriter::writeTerm
void writeTerm(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength)
Lucene::DirectoryPtr
boost::shared_ptr< Directory > DirectoryPtr
Definition: LuceneTypes.h:489
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::TermInfosWriter::indexInterval
int32_t indexInterval
The fraction of terms in the "dictionary" which should be stored in RAM. Smaller values use more memo...
Definition: TermInfosWriter.h:37
Lucene::TermInfosWriter::output
IndexOutputPtr output
Definition: TermInfosWriter.h:51
Lucene::TermInfosWriter
This stores a monotonically increasing set of <Term, TermInfo> pairs in a Directory. A TermInfos can be written once, in order.
Definition: TermInfosWriter.h:16
Lucene::TermInfosWriter::initUnicodeResults
bool initUnicodeResults()
Currently used only by assert statements.
Lucene::TermInfosWriter::_other
TermInfosWriterWeakPtr _other
Definition: TermInfosWriter.h:62
Lucene::TermInfosWriter::unicodeResult2
UnicodeResultPtr unicodeResult2
Definition: TermInfosWriter.h:67
Lucene::TermInfosWriter::size
int64_t size
Definition: TermInfosWriter.h:53
Lucene::TermInfosWriter::close
void close()
Called to complete TermInfos creation.
Lucene::TermInfoPtr
boost::shared_ptr< TermInfo > TermInfoPtr
Definition: LuceneTypes.h:239
Lucene::TermInfosWriter::TermInfosWriter
TermInfosWriter(const DirectoryPtr &directory, const String &segment, const FieldInfosPtr &fis, int32_t interval)
Lucene::TermInfosWriter::unicodeResult1
UnicodeResultPtr unicodeResult1
Definition: TermInfosWriter.h:66
Lucene::TermInfosWriter::compareToLastTerm
int32_t compareToLastTerm(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength)
Currently used only by assert statement.
Lucene::TermInfosWriter::otherWriter
TermInfosWriterPtr otherWriter
Definition: TermInfosWriter.h:61
Lucene::TermInfosWriter::utf8Result
UTF8ResultPtr utf8Result
Definition: TermInfosWriter.h:63
Lucene::TermInfosWriter::lastFieldNumber
int32_t lastFieldNumber
Definition: TermInfosWriter.h:59
Lucene::TermInfosWriter::skipInterval
int32_t skipInterval
The fraction of TermDocs entries stored in skip tables, used to accelerate TermDocs#skipTo(int). Larger values result in smaller indexes, greater acceleration, but fewer accelerable cases, while smaller values result in bigger indexes, less acceleration and more accelerable cases. More detailed experiments would be useful here.
Definition: TermInfosWriter.h:43
Lucene::TermInfosWriter::lastTi
TermInfoPtr lastTi
Definition: TermInfosWriter.h:52
Lucene::FieldInfosPtr
boost::shared_ptr< FieldInfos > FieldInfosPtr
Definition: LuceneTypes.h:127
Lucene::TermInfosWriterPtr
boost::shared_ptr< TermInfosWriter > TermInfosWriterPtr
Definition: LuceneTypes.h:242

clucene.sourceforge.net