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 // 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 TERMINFOSWRITER_H
8 #define TERMINFOSWRITER_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene
13 {
17  {
18  public:
19  TermInfosWriter(DirectoryPtr directory, const String& segment, FieldInfosPtr fis, int32_t interval);
20  TermInfosWriter(DirectoryPtr directory, const String& segment, FieldInfosPtr fis, int32_t interval, bool isIndex);
21  virtual ~TermInfosWriter();
22 
24 
25  public:
27  static const int32_t FORMAT;
28 
31 
33  static const int32_t FORMAT_CURRENT;
34 
38  int32_t indexInterval;
39 
44  int32_t skipInterval;
45 
48  int32_t maxSkipLevels;
49 
50  protected:
54  int64_t size;
55 
57  bool isIndex;
58  ByteArray lastTermBytes;
60  int32_t lastFieldNumber;
61 
65 
66  // Currently used only by assert statements
69 
70  public:
71  virtual void initialize();
72 
73  void add(TermPtr term, TermInfoPtr ti);
74 
77  void add(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength, TermInfoPtr ti);
78 
80  void close();
81 
82  protected:
83  void initialize(DirectoryPtr directory, const String& segment, FieldInfosPtr fis, int32_t interval, bool isi);
84 
86  bool initUnicodeResults();
87 
89  int32_t compareToLastTerm(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength);
90 
91  void writeTerm(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength);
92  };
93 }
94 
95 #endif

clucene.sourceforge.net