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
FreqProxTermsWriter.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 FREQPROXTERMSWRITER_H
8
#define FREQPROXTERMSWRITER_H
9
10
#include "
TermsHashConsumer.h
"
11
#include "
RawPostingList.h
"
12
13
namespace
Lucene
14
{
15
class
FreqProxTermsWriter
:
public
TermsHashConsumer
16
{
17
public
:
18
virtual
~FreqProxTermsWriter
();
19
20
LUCENE_CLASS
(
FreqProxTermsWriter
);
21
22
protected
:
23
ByteArray
payloadBuffer
;
24
25
public
:
26
virtual
TermsHashConsumerPerThreadPtr
addThread
(
TermsHashPerThreadPtr
perThread);
27
virtual
void
createPostings
(
Collection<RawPostingListPtr>
postings, int32_t start, int32_t count);
28
virtual
void
closeDocStore
(
SegmentWriteStatePtr
state);
29
virtual
void
abort
();
30
virtual
void
flush
(MapTermsHashConsumerPerThreadCollectionTermsHashConsumerPerField threadsAndFields,
SegmentWriteStatePtr
state);
31
34
void
appendPostings
(
Collection<FreqProxTermsWriterPerFieldPtr>
fields,
FormatPostingsFieldsConsumerPtr
consumer);
35
36
virtual
int32_t
bytesPerPosting
();
37
38
protected
:
39
static
int32_t
compareText
(
const
wchar_t
* text1, int32_t pos1,
const
wchar_t
* text2, int32_t pos2);
40
};
41
42
class
FreqProxTermsWriterPostingList
:
public
RawPostingList
43
{
44
public
:
45
FreqProxTermsWriterPostingList
();
46
virtual
~FreqProxTermsWriterPostingList
();
47
48
LUCENE_CLASS
(
FreqProxTermsWriterPostingList
);
49
50
public
:
51
int32_t
docFreq
;
// # times this term occurs in the current doc
52
int32_t
lastDocID
;
// Last docID where this term occurred
53
int32_t
lastDocCode
;
// Code for prior doc
54
int32_t
lastPosition
;
// Last position where this term occurred
55
};
56
}
57
58
#endif
clucene.sourceforge.net