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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ParallelReader.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 PARALLELREADER_H
8 #define PARALLELREADER_H
9
10 #include "IndexReader.h"
11
12 namespace Lucene
13 {
26 class LPPAPI ParallelReader : public IndexReader
27 {
28 public:
32 ParallelReader(bool closeSubReaders = true);
33
34 virtual ~ParallelReader();
35
36 LUCENE_CLASS(ParallelReader);
37
38 protected:
39 Collection<IndexReaderPtr> readers;
40 Collection<uint8_t> decrefOnClose; // remember which subreaders to decRef on close
41 bool incRefReaders;
42 MapStringIndexReader fieldToReader;
43 MapIndexReaderSetString readerToFields;
44 Collection<IndexReaderPtr> storedFieldReaders;
45
46 int32_t _maxDoc;
47 int32_t _numDocs;
48 bool _hasDeletions;
49
50 public:
52 void add(IndexReaderPtr reader);
53
56 void add(IndexReaderPtr reader, bool ignoreStoredFields);
57
58 virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr());
59
71 virtual IndexReaderPtr reopen();
72
74 virtual int32_t numDocs();
75
78 virtual int32_t maxDoc();
79
81 virtual bool hasDeletions();
82
84 virtual bool isDeleted(int32_t n);
85
87 virtual DocumentPtr document(int32_t n, FieldSelectorPtr fieldSelector);
88
90 virtual Collection<TermFreqVectorPtr> getTermFreqVectors(int32_t docNumber);
91
93 virtual TermFreqVectorPtr getTermFreqVector(int32_t docNumber, const String& field);
94
97 virtual void getTermFreqVector(int32_t docNumber, const String& field, TermVectorMapperPtr mapper);
98
100 virtual void getTermFreqVector(int32_t docNumber, TermVectorMapperPtr mapper);
101
103 virtual bool hasNorms(const String& field);
104
106 virtual ByteArray norms(const String& field);
107
109 virtual void norms(const String& field, ByteArray norms, int32_t offset);
110
115 virtual TermEnumPtr terms();
116
121 virtual TermEnumPtr terms(TermPtr t);
122
124 virtual int32_t docFreq(TermPtr t);
125
131 virtual TermDocsPtr termDocs(TermPtr term);
132
134 virtual TermDocsPtr termDocs();
135
137 virtual TermPositionsPtr termPositions(TermPtr term);
138
140 virtual TermPositionsPtr termPositions();
141
143 virtual bool isCurrent();
144
146 virtual bool isOptimized();
147
149 virtual int64_t getVersion();
150
151 Collection<IndexReaderPtr> getSubReaders();
152
155 virtual HashSet<String> getFieldNames(FieldOption fieldOption);
156
157 protected:
158 IndexReaderPtr doReopen(bool doClone);
159
161 virtual void doDelete(int32_t docNum);
162
164 virtual void doUndeleteAll();
165
167 virtual void doSetNorm(int32_t doc, const String& field, uint8_t value);
168
170 virtual void doCommit(MapStringString commitUserData);
171
173 virtual void doClose();
174
175 friend class ParallelTermEnum;
176 friend class ParallelTermDocs;
177 friend class ParallelTermPositions;
178 };
179 }
180
181 #endif

clucene.sourceforge.net