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
MultiReader.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 MULTIREADER_H
8 #define MULTIREADER_H
9
10 #include "IndexReader.h"
11
12 namespace Lucene
13 {
15 class LPPAPI MultiReader : public IndexReader
16 {
17 public:
22 MultiReader(Collection<IndexReaderPtr> subReaders, bool closeSubReaders = true);
23
24 virtual ~MultiReader();
25
26 LUCENE_CLASS(MultiReader);
27
28 protected:
29 Collection<IndexReaderPtr> subReaders;
30 Collection<int32_t> starts; // 1st docno for each segment
31 Collection<uint8_t> decrefOnClose; // remember which subreaders to decRef on close
32 MapStringByteArray normsCache;
33 int32_t _maxDoc;
34 int32_t _numDocs;
35 bool _hasDeletions;
36
37 public:
49 virtual IndexReaderPtr reopen();
50
55 virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr());
56
57 virtual Collection<TermFreqVectorPtr> getTermFreqVectors(int32_t docNumber);
58 virtual TermFreqVectorPtr getTermFreqVector(int32_t docNumber, const String& field);
59 virtual void getTermFreqVector(int32_t docNumber, const String& field, TermVectorMapperPtr mapper);
60 virtual void getTermFreqVector(int32_t docNumber, TermVectorMapperPtr mapper);
61
62 virtual bool isOptimized();
63
65 virtual int32_t numDocs();
66
68 virtual int32_t maxDoc();
69
72 virtual DocumentPtr document(int32_t n, FieldSelectorPtr fieldSelector);
73
75 virtual bool isDeleted(int32_t n);
76
78 virtual bool hasDeletions();
79
81 virtual bool hasNorms(const String& field);
82
84 virtual ByteArray norms(const String& field);
85
87 virtual void norms(const String& field, ByteArray norms, int32_t offset);
88
90 virtual TermEnumPtr terms();
91
93 virtual TermEnumPtr terms(TermPtr t);
94
96 virtual int32_t docFreq(TermPtr t);
97
99 virtual TermDocsPtr termDocs();
100
102 virtual TermPositionsPtr termPositions();
103
106 virtual HashSet<String> getFieldNames(FieldOption fieldOption);
107
109 virtual bool isCurrent();
110
112 virtual int64_t getVersion();
113
115 virtual Collection<IndexReaderPtr> getSequentialSubReaders();
116
117 protected:
121 IndexReaderPtr doReopen(bool doClone);
122
124 virtual void doDelete(int32_t docNum);
125
127 virtual void doUndeleteAll();
128
130 int32_t readerIndex(int32_t n);
131
133 virtual void doSetNorm(int32_t doc, const String& field, uint8_t value);
134
135 virtual void doCommit(MapStringString commitUserData);
136
138 virtual void doClose();
139 };
140 }
141
142 #endif

clucene.sourceforge.net