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 // Copyright (c) 2009-2011 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  {
22  public:
25  virtual ~CheckIndex();
26 
28 
29  protected:
30  InfoStreamPtr infoStream;
32 
33  static bool _assertsOn;
34 
35  public:
37  void setInfoStream(InfoStreamPtr out);
38 
44  IndexStatusPtr checkIndex();
45 
54  IndexStatusPtr checkIndex(Collection<String> onlySegments);
55 
64  void fixIndex(IndexStatusPtr result);
65 
66  static bool testAsserts();
67  static bool assertsOn();
68 
90  static int main(Collection<String> args);
91 
92  protected:
93  void msg(const String& msg);
94 
96  FieldNormStatusPtr testFieldNorms(Collection<String> fieldNames, SegmentReaderPtr reader);
97 
99  TermIndexStatusPtr testTermIndex(SegmentInfoPtr info, SegmentReaderPtr reader);
100 
102  StoredFieldStatusPtr testStoredFields(SegmentInfoPtr info, SegmentReaderPtr reader);
103 
105  TermVectorStatusPtr testTermVectors(SegmentInfoPtr info, SegmentReaderPtr reader);
106  };
107 
109  class LPPAPI IndexStatus : public LuceneObject
110  {
111  public:
112  IndexStatus();
113  virtual ~IndexStatus();
114 
116 
117  public:
119  bool clean;
120 
123 
126 
129 
132 
134  int32_t numSegments;
135 
138 
142 
145 
148 
151 
155 
158 
160  int32_t numBadSegments;
161 
163  bool partial;
164 
166  MapStringString userData;
167  };
168 
170  class LPPAPI SegmentInfoStatus : public LuceneObject
171  {
172  public:
174  virtual ~SegmentInfoStatus();
175 
177 
178  public:
180  String name;
181 
183  int32_t docCount;
184 
186  bool compound;
187 
189  int32_t numFiles;
190 
192  double sizeMB;
193 
196  int32_t docStoreOffset;
197 
200 
203 
206 
209 
211  int32_t numDeleted;
212 
215 
217  int32_t numFields;
218 
221  bool hasProx;
222 
224  MapStringString diagnostics;
225 
228 
231 
234 
237  };
238 
240  class LPPAPI FieldNormStatus : public LuceneObject
241  {
242  public:
243  FieldNormStatus();
244  virtual ~FieldNormStatus();
245 
247 
248  public:
250  int64_t totFields;
251 
254  };
255 
257  class LPPAPI TermIndexStatus : public LuceneObject
258  {
259  public:
260  TermIndexStatus();
261  virtual ~TermIndexStatus();
262 
264 
265  public:
267  int64_t termCount;
268 
270  int64_t totFreq;
271 
273  int64_t totPos;
274 
277  };
278 
280  class LPPAPI StoredFieldStatus : public LuceneObject
281  {
282  public:
284  virtual ~StoredFieldStatus();
285 
287 
288  public:
290  int32_t docCount;
291 
293  int64_t totFields;
294 
297  };
298 
300  class LPPAPI TermVectorStatus : public LuceneObject
301  {
302  public:
304  virtual ~TermVectorStatus();
305 
307 
308  public:
310  int32_t docCount;
311 
313  int64_t totVectors;
314 
317  };
318 }
319 
320 #endif

clucene.sourceforge.net