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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TermInfosReader.h
Go to the documentation of this file.
1 
2 // 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 TERMINFOSREADER_H
8 #define TERMINFOSREADER_H
9 
10 #include "CloseableThreadLocal.h"
11 #include "SimpleLRUCache.h"
12 
13 namespace Lucene {
14 
17 class TermInfosReader : public LuceneObject {
18 public:
19  TermInfosReader(const DirectoryPtr& dir, const String& seg, const FieldInfosPtr& fis, int32_t readBufferSize, int32_t indexDivisor);
20  virtual ~TermInfosReader();
21 
23 
24 protected:
26  String segment;
30  int64_t _size;
31 
35 
37 
38  static const int32_t DEFAULT_CACHE_SIZE;
39 
40 public:
41  int32_t getSkipInterval();
42  int32_t getMaxSkipLevels();
43  void close();
44 
46  int64_t size();
47 
49  TermInfoPtr get(const TermPtr& term);
50 
52  int64_t getPosition(const TermPtr& term);
53 
56 
58  SegmentTermEnumPtr terms(const TermPtr& term);
59 
60 protected:
62 
64  int32_t getIndexOffset(const TermPtr& term);
65 
66  void seekEnum(const SegmentTermEnumPtr& enumerator, int32_t indexOffset);
67 
69  TermInfoPtr get(const TermPtr& term, bool useCache);
70 
71  void ensureIndexIsRead();
72 };
73 
75 public:
77 
79 
80 public:
82 
83  // Used for caching the least recently looked-up Terms
84  TermInfoCachePtr termInfoCache;
85 };
86 
87 }
88 
89 #endif

clucene.sourceforge.net