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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FieldsWriter.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 FIELDSWRITER_H
8 #define FIELDSWRITER_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene
13 {
14  class FieldsWriter : public LuceneObject
15  {
16  public:
17  FieldsWriter(DirectoryPtr d, const String& segment, FieldInfosPtr fn);
19  virtual ~FieldsWriter();
20 
22 
23  protected:
27  bool doClose;
28 
29  public:
30  static const uint8_t FIELD_IS_TOKENIZED;
31  static const uint8_t FIELD_IS_BINARY;
32  static const uint8_t FIELD_IS_COMPRESSED;
33 
34  static const int32_t FORMAT; // Original format
35  static const int32_t FORMAT_VERSION_UTF8_LENGTH_IN_BYTES; // Changed strings to UTF8
36  static const int32_t FORMAT_LUCENE_3_0_NO_COMPRESSED_FIELDS; // Lucene 3.0: Removal of compressed fields
37 
38  // NOTE: if you introduce a new format, make it 1 higher than the current one, and always change this
39  // if you switch to a new format!
40  static const int32_t FORMAT_CURRENT;
41 
42  public:
43  void setFieldsStream(IndexOutputPtr stream);
44 
47  void flushDocument(int32_t numStoredFields, RAMOutputStreamPtr buffer);
48 
49  void skipDocument();
50  void flush();
51  void close();
52  void writeField(FieldInfoPtr fi, FieldablePtr field);
53 
56  void addRawDocuments(IndexInputPtr stream, Collection<int32_t> lengths, int32_t numDocs);
57 
58  void addDocument(DocumentPtr doc);
59  };
60 }
61 
62 #endif

clucene.sourceforge.net