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

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

- File List
- Globals

MultiReader.h
Go to the documentation of this file.
1 // 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 MULTIREADER_H
8 #define MULTIREADER_H
9
10 #include "IndexReader.h"
11
12 namespace Lucene {
13
15 class LPPAPI MultiReader : public IndexReader {
16 public:
21 MultiReader(Collection<IndexReaderPtr> subReaders, bool closeSubReaders = true);
22
23 virtual ~MultiReader();
24
25 LUCENE_CLASS(MultiReader);
26
27 protected:
28 Collection<IndexReaderPtr> subReaders;
29 Collection<int32_t> starts; // 1st docno for each segment
30 Collection<uint8_t> decrefOnClose; // remember which subreaders to decRef on close
31 MapStringByteArray normsCache;
32 int32_t _maxDoc;
33 int32_t _numDocs;
34 bool _hasDeletions;
35
36 public:
48 virtual IndexReaderPtr reopen();
49
54 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
55
56 virtual Collection<TermFreqVectorPtr> getTermFreqVectors(int32_t docNumber);
57 virtual TermFreqVectorPtr getTermFreqVector(int32_t docNumber, const String& field);
58 virtual void getTermFreqVector(int32_t docNumber, const String& field, const TermVectorMapperPtr& mapper);
59 virtual void getTermFreqVector(int32_t docNumber, const TermVectorMapperPtr& mapper);
60
61 virtual bool isOptimized();
62
64 virtual int32_t numDocs();
65
67 virtual int32_t maxDoc();
68
71 virtual DocumentPtr document(int32_t n, const FieldSelectorPtr& fieldSelector);
72
74 virtual bool isDeleted(int32_t n);
75
77 virtual bool hasDeletions();
78
80 virtual bool hasNorms(const String& field);
81
83 virtual ByteArray norms(const String& field);
84
86 virtual void norms(const String& field, ByteArray norms, int32_t offset);
87
89 virtual TermEnumPtr terms();
90
92 virtual TermEnumPtr terms(const TermPtr& t);
93
95 virtual int32_t docFreq(const TermPtr& t);
96
98 virtual TermDocsPtr termDocs();
99
101 virtual TermPositionsPtr termPositions();
102
105 virtual HashSet<String> getFieldNames(FieldOption fieldOption);
106
108 virtual bool isCurrent();
109
111 virtual int64_t getVersion();
112
114 virtual Collection<IndexReaderPtr> getSequentialSubReaders();
115
116 protected:
120 IndexReaderPtr doReopen(bool doClone);
121
123 virtual void doDelete(int32_t docNum);
124
126 virtual void doUndeleteAll();
127
129 int32_t readerIndex(int32_t n);
130
132 virtual void doSetNorm(int32_t doc, const String& field, uint8_t value);
133
134 virtual void doCommit(MapStringString commitUserData);
135
137 virtual void doClose();
138 };
139
140 }
141
142 #endif
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::TermDocsPtr
boost::shared_ptr< TermDocs > TermDocsPtr
Definition: LuceneTypes.h:236
Lucene::TermEnumPtr
boost::shared_ptr< TermEnum > TermEnumPtr
Definition: LuceneTypes.h:235
Lucene::FieldSelectorPtr
boost::shared_ptr< FieldSelector > FieldSelectorPtr
Definition: LuceneTypes.h:77
Lucene::MultiReader::_hasDeletions
bool _hasDeletions
Definition: MultiReader.h:34
Lucene::MultiReader::_numDocs
int32_t _numDocs
Definition: MultiReader.h:33
Lucene::MultiReader::_maxDoc
int32_t _maxDoc
Definition: MultiReader.h:32
Lucene::MultiReader::decrefOnClose
Collection< uint8_t > decrefOnClose
Definition: MultiReader.h:30
Lucene::MultiReader::starts
Collection< int32_t > starts
Definition: MultiReader.h:29
IndexReader.h
Lucene::DocumentPtr
boost::shared_ptr< Document > DocumentPtr
Definition: LuceneTypes.h:74
Lucene::HashSet< String >
Lucene::IndexReader::FieldOption
FieldOption
Constants describing field properties, for example used for IndexReader#getFieldNames(FieldOption).
Definition: IndexReader.h:48
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
Lucene::TermVectorMapperPtr
boost::shared_ptr< TermVectorMapper > TermVectorMapperPtr
Definition: LuceneTypes.h:254
Lucene::TermPositionsPtr
boost::shared_ptr< TermPositions > TermPositionsPtr
Definition: LuceneTypes.h:243
Lucene::MultiReader
An IndexReader which reads multiple indexes, appending their content.
Definition: MultiReader.h:15
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::Collection< IndexReaderPtr >
Lucene::MultiReader::normsCache
MapStringByteArray normsCache
Definition: MultiReader.h:31
Lucene::IndexReader
IndexReader is an abstract class, providing an interface for accessing an index. Search of an index i...
Definition: IndexReader.h:39
Lucene::TermFreqVectorPtr
boost::shared_ptr< TermFreqVector > TermFreqVectorPtr
Definition: LuceneTypes.h:237
Lucene::MultiReader::subReaders
Collection< IndexReaderPtr > subReaders
Definition: MultiReader.h:25

clucene.sourceforge.net