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 // 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 TERMINFOSREADER_H
8 #define TERMINFOSREADER_H
9 
10 #include "CloseableThreadLocal.h"
11 #include "SimpleLRUCache.h"
12 
13 namespace Lucene
14 {
18  {
19  public:
20  TermInfosReader(DirectoryPtr dir, const String& seg, FieldInfosPtr fis, int32_t readBufferSize, int32_t indexDivisor);
21  virtual ~TermInfosReader();
22 
24 
25  protected:
27  String segment;
31  int64_t _size;
32 
36 
38 
39  static const int32_t DEFAULT_CACHE_SIZE;
40 
41  public:
42  int32_t getSkipInterval();
43  int32_t getMaxSkipLevels();
44  void close();
45 
47  int64_t size();
48 
50  TermInfoPtr get(TermPtr term);
51 
53  int64_t getPosition(TermPtr term);
54 
57 
60 
61  protected:
63 
65  int32_t getIndexOffset(TermPtr term);
66 
67  void seekEnum(SegmentTermEnumPtr enumerator, int32_t indexOffset);
68 
70  TermInfoPtr get(TermPtr term, bool useCache);
71 
72  void ensureIndexIsRead();
73  };
74 
76  {
77  public:
79 
81 
82  public:
84 
85  // Used for caching the least recently looked-up Terms
86  TermInfoCachePtr termInfoCache;
87  };
88 }
89 
90 #endif

clucene.sourceforge.net