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


Loading...
Searching...
No Matches
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
11#include "SimpleLRUCache.h"
12
13namespace Lucene {
14
18public:
19 TermInfosReader(const DirectoryPtr& dir, const String& seg, const FieldInfosPtr& fis, int32_t readBufferSize, int32_t indexDivisor);
21
23
24protected:
26 String segment;
30 int64_t _size;
31
35
37
38 static const int32_t DEFAULT_CACHE_SIZE;
39
40public:
41 int32_t getSkipInterval();
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
59
60protected:
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
72};
73
75public:
77
79
80public:
82
83 // Used for caching the least recently looked-up Terms
84 TermInfoCachePtr termInfoCache;
85};
86
87}
88
89#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
General purpose thread-local map.
Definition CloseableThreadLocal.h:16
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Base class for all Lucene classes.
Definition LuceneObject.h:31
Definition TermInfosReader.h:74
SegmentTermEnumPtr termEnum
Definition TermInfosReader.h:81
TermInfoCachePtr termInfoCache
Definition TermInfosReader.h:84
This stores a monotonically increasing set of <Term, TermInfo> pairs in a Directory....
Definition TermInfosReader.h:17
CloseableThreadLocal< TermInfosReaderThreadResources > threadResources
Definition TermInfosReader.h:28
int64_t getPosition(const TermPtr &term)
Returns the position of a Term in the set or -1.
static const int32_t DEFAULT_CACHE_SIZE
Definition TermInfosReader.h:38
Collection< TermPtr > indexTerms
Definition TermInfosReader.h:32
TermInfosReader(const DirectoryPtr &dir, const String &seg, const FieldInfosPtr &fis, int32_t readBufferSize, int32_t indexDivisor)
SegmentTermEnumPtr terms()
Returns an enumeration of all the Terms and TermInfos in the set.
int32_t totalIndexInterval
Definition TermInfosReader.h:36
TermInfosReaderThreadResourcesPtr getThreadResources()
int64_t _size
Definition TermInfosReader.h:30
TermInfoPtr get(const TermPtr &term, bool useCache)
Returns the TermInfo for a Term in the set, or null.
DirectoryPtr directory
Definition TermInfosReader.h:25
TermInfoPtr get(const TermPtr &term)
Returns the TermInfo for a Term in the set, or null.
void seekEnum(const SegmentTermEnumPtr &enumerator, int32_t indexOffset)
Collection< int64_t > indexPointers
Definition TermInfosReader.h:34
int32_t getIndexOffset(const TermPtr &term)
Returns the offset of the greatest index entry which is less than or equal to term.
SegmentTermEnumPtr terms(const TermPtr &term)
Returns an enumeration of terms starting at or after the named term.
int64_t size()
Returns the number of term/value pairs in the set.
SegmentTermEnumPtr origEnum
Definition TermInfosReader.h:29
String segment
Definition TermInfosReader.h:26
FieldInfosPtr fieldInfos
Definition TermInfosReader.h:27
Collection< TermInfoPtr > indexInfos
Definition TermInfosReader.h:33
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< SegmentTermEnum > SegmentTermEnumPtr
Definition LuceneTypes.h:218
boost::shared_ptr< FieldInfos > FieldInfosPtr
Definition LuceneTypes.h:127
boost::shared_ptr< Term > TermPtr
Definition LuceneTypes.h:233
boost::shared_ptr< Directory > DirectoryPtr
Definition LuceneTypes.h:489
boost::shared_ptr< TermInfosReaderThreadResources > TermInfosReaderThreadResourcesPtr
Definition LuceneTypes.h:241
boost::shared_ptr< TermInfo > TermInfoPtr
Definition LuceneTypes.h:239

clucene.sourceforge.net