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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CheckIndex.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 CHECKINDEX_H
8 #define CHECKINDEX_H
9 
10 #include "SegmentTermDocs.h"
11 
12 namespace Lucene {
13 
20 class LPPAPI CheckIndex : public LuceneObject {
21 public:
23  CheckIndex(const DirectoryPtr& dir);
24  virtual ~CheckIndex();
25 
27 
28 protected:
29  InfoStreamPtr infoStream;
31 
32  static bool _assertsOn;
33 
34 public:
36  void setInfoStream(const InfoStreamPtr& out);
37 
43  IndexStatusPtr checkIndex();
44 
53  IndexStatusPtr checkIndex(Collection<String> onlySegments);
54 
63  void fixIndex(const IndexStatusPtr& result);
64 
65  static bool testAsserts();
66  static bool assertsOn();
67 
89  static int main(Collection<String> args);
90 
91 protected:
92  void msg(const String& msg);
93 
95  FieldNormStatusPtr testFieldNorms(Collection<String> fieldNames, const SegmentReaderPtr& reader);
96 
98  TermIndexStatusPtr testTermIndex(const SegmentInfoPtr& info, const SegmentReaderPtr& reader);
99 
101  StoredFieldStatusPtr testStoredFields(const SegmentInfoPtr& info, const SegmentReaderPtr& reader);
102 
104  TermVectorStatusPtr testTermVectors(const SegmentInfoPtr& info, const SegmentReaderPtr& reader);
105 };
106 
108 class LPPAPI IndexStatus : public LuceneObject {
109 public:
110  IndexStatus();
111  virtual ~IndexStatus();
112 
114 
115 public:
117  bool clean;
118 
121 
124 
127 
130 
132  int32_t numSegments;
133 
136 
140 
143 
146 
149 
153 
156 
158  int32_t numBadSegments;
159 
161  bool partial;
162 
164  MapStringString userData;
165 };
166 
168 class LPPAPI SegmentInfoStatus : public LuceneObject {
169 public:
171  virtual ~SegmentInfoStatus();
172 
174 
175 public:
177  String name;
178 
180  int32_t docCount;
181 
183  bool compound;
184 
186  int32_t numFiles;
187 
189  double sizeMB;
190 
193  int32_t docStoreOffset;
194 
197 
200 
203 
206 
208  int32_t numDeleted;
209 
212 
214  int32_t numFields;
215 
218  bool hasProx;
219 
221  MapStringString diagnostics;
222 
225 
228 
231 
234 };
235 
237 class LPPAPI FieldNormStatus : public LuceneObject {
238 public:
239  FieldNormStatus();
240  virtual ~FieldNormStatus();
241 
243 
244 public:
246  int64_t totFields;
247 
250 };
251 
253 class LPPAPI TermIndexStatus : public LuceneObject {
254 public:
255  TermIndexStatus();
256  virtual ~TermIndexStatus();
257 
259 
260 public:
262  int64_t termCount;
263 
265  int64_t totFreq;
266 
268  int64_t totPos;
269 
272 };
273 
275 class LPPAPI StoredFieldStatus : public LuceneObject {
276 public:
278  virtual ~StoredFieldStatus();
279 
281 
282 public:
284  int32_t docCount;
285 
287  int64_t totFields;
288 
291 };
292 
294 class LPPAPI TermVectorStatus : public LuceneObject {
295 public:
297  virtual ~TermVectorStatus();
298 
300 
301 public:
303  int32_t docCount;
304 
306  int64_t totVectors;
307 
310 };
311 
312 }
313 
314 #endif

clucene.sourceforge.net