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


DirectoryReader.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 DIRECTORYREADER_H
8 #define DIRECTORYREADER_H
9 
10 #include "IndexReader.h"
11 #include "TermEnum.h"
12 #include "TermPositions.h"
13 #include "IndexCommit.h"
14 #include "SegmentMergeQueue.h"
15 
16 namespace Lucene {
17 
19 class LPPAPI DirectoryReader : public IndexReader {
20 public:
22  DirectoryReader(const DirectoryPtr& directory, const SegmentInfosPtr& sis, const IndexDeletionPolicyPtr& deletionPolicy, bool readOnly, int32_t termInfosIndexDivisor);
23 
25  DirectoryReader(const IndexWriterPtr& writer, const SegmentInfosPtr& infos, int32_t termInfosIndexDivisor);
26 
28  DirectoryReader(const DirectoryPtr& directory, const SegmentInfosPtr& infos, Collection<SegmentReaderPtr> oldReaders,
29  Collection<int32_t> oldStarts, MapStringByteArray oldNormsCache, bool readOnly,
30  bool doClone, int32_t termInfosIndexDivisor);
31 
32  virtual ~DirectoryReader();
33 
35 
36 protected:
38  bool readOnly;
45  bool stale;
47 
49 
51  Collection<int32_t> starts; // 1st docno for each segment
52  MapStringByteArray normsCache;
53  int32_t _maxDoc;
54  int32_t _numDocs;
56 
57  // Max version in index as of when we opened; this can be > our current segmentInfos version
58  // in case we were opened on a past IndexCommit
59  int64_t