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
include
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
22
LUCENE_CLASS
(
TermInfosReader
);
23
24
protected
:
25
DirectoryPtr
directory
;
26
String
segment
;
27
FieldInfosPtr
fieldInfos
;
28
CloseableThreadLocal<TermInfosReaderThreadResources>
threadResources
;
29
SegmentTermEnumPtr
origEnum
;
30
int64_t
_size
;
31
32
Collection<TermPtr>
indexTerms
;
33
Collection<TermInfoPtr>
indexInfos
;
34
Collection<int64_t>
indexPointers
;
35
36
int32_t
totalIndexInterval
;
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
55
SegmentTermEnumPtr
terms
();
56
58
SegmentTermEnumPtr
terms
(
const
TermPtr
& term);
59
60
protected
:
61
TermInfosReaderThreadResourcesPtr
getThreadResources
();
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
74
class
TermInfosReaderThreadResources
:
public
LuceneObject
{
75
public
:
76
virtual
~TermInfosReaderThreadResources
();
77
78
LUCENE_CLASS
(
TermInfosReaderThreadResources
);
79
80
public
:
81
SegmentTermEnumPtr
termEnum
;
82
83
// Used for caching the least recently looked-up Terms
84
TermInfoCachePtr
termInfoCache
;
85
};
86
87
}
88
89
#endif
clucene.sourceforge.net