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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TermInfosWriter.h
Go to the documentation of this file.
1 
2 // 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 
23 
24 public:
26  static const int32_t FORMAT;
27 
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:
53  int64_t size;
54 
56  bool isIndex;
57  ByteArray lastTermBytes;
59  int32_t lastFieldNumber;
60 
64 
65  // Currently used only by assert statements
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

clucene.sourceforge.net