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
TermsHashPerField.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 TERMSHASHPERFIELD_H
8
#define TERMSHASHPERFIELD_H
9
10
#include "
InvertedDocConsumerPerField.h
"
11
12
namespace
Lucene
13
{
14
class
TermsHashPerField
:
public
InvertedDocConsumerPerField
15
{
16
public
:
17
TermsHashPerField
(
DocInverterPerFieldPtr
docInverterPerField,
TermsHashPerThreadPtr
perThread,
TermsHashPerThreadPtr
nextPerThread
,
FieldInfoPtr
fieldInfo
);
18
virtual
~TermsHashPerField
();
19
20
LUCENE_CLASS
(
TermsHashPerField
);
21
22
public
:
23
TermsHashConsumerPerFieldPtr
consumer
;
24
TermsHashPerFieldPtr
nextPerField
;
25
DocInverterPerFieldWeakPtr
_docInverterPerField
;
26
TermsHashPerThreadPtr
nextPerThread
;
27
TermsHashPerThreadWeakPtr
_perThread
;
28
DocStatePtr
docState
;
29
FieldInvertStatePtr
fieldState
;
30
TermAttributePtr
termAtt
;
31
32
// Copied from our perThread
33
CharBlockPoolPtr
charPool
;
34
IntBlockPoolPtr
intPool
;
35
ByteBlockPoolPtr
bytePool
;
36
37
int32_t
streamCount
;
38
int32_t
numPostingInt
;
39
40
FieldInfoPtr
fieldInfo
;
41
42
bool
postingsCompacted
;
43
int32_t
numPostings
;
44
45
IntArray
intUptos
;
46
int32_t
intUptoStart
;
47
48
protected
:
49
int32_t
postingsHashSize
;
50
int32_t
postingsHashHalfSize
;
51
int32_t
postingsHashMask
;
52
Collection<RawPostingListPtr>
postingsHash
;
53
RawPostingListPtr
p
;
54
bool
doCall
;
55
bool
doNextCall
;
56
57
public
:
58
virtual
void
initialize
();
59
void
shrinkHash
(int32_t targetSize);
60
void
reset
();
61
63
virtual
void
abort
();
64
65
void
initReader
(
ByteSliceReaderPtr
reader,
RawPostingListPtr
p
, int32_t stream);
66
68
Collection<RawPostingListPtr>
sortPostings
();
69
71
virtual
void
start
(
FieldablePtr
field);
72
74
virtual
bool
start
(
Collection<FieldablePtr>
fields, int32_t count);
75
76
void
add
(int32_t textStart);
77
79
virtual
void
add
();
80
81
void
writeByte
(int32_t stream, int8_t b);
82
void
writeBytes
(int32_t stream,
const
uint8_t* b, int32_t offset, int32_t length);
83
void
writeVInt
(int32_t stream, int32_t i);
84
86
virtual
void
finish
();
87
89
void
rehashPostings
(int32_t newSize);
90
91
protected
:
92
void
compactPostings
();
93
95
bool
postingEquals
(
const
wchar_t
* tokenText, int32_t tokenTextLen);
96
};
97
}
98
99
#endif
clucene.sourceforge.net