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
TermVectorsTermsWriter.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 TERMVECTORSTERMSWRITER_H
8
#define TERMVECTORSTERMSWRITER_H
9
10
#include "
TermsHashConsumer.h
"
11
#include "
DocumentsWriter.h
"
12
#include "
RawPostingList.h
"
13
14
namespace
Lucene {
15
16
class
TermVectorsTermsWriter
:
public
TermsHashConsumer
{
17
public
:
18
TermVectorsTermsWriter
(
const
DocumentsWriterPtr
& docWriter);
19
virtual
~TermVectorsTermsWriter
();
20
21
LUCENE_CLASS
(
TermVectorsTermsWriter
);
22
23
public
:
24
DocumentsWriterWeakPtr
_docWriter
;
25
TermVectorsWriterPtr
termVectorsWriter
;
26
Collection<TermVectorsTermsWriterPerDocPtr>
docFreeList
;
27
int32_t
freeCount
;
28
IndexOutputPtr
tvx
;
29
IndexOutputPtr
tvd
;
30
IndexOutputPtr
tvf
;
31
int32_t
lastDocID
;
32
int32_t
allocCount
;
33
34
public
:
35
virtual
TermsHashConsumerPerThreadPtr
addThread
(
const
TermsHashPerThreadPtr
& perThread);
36
virtual
void
createPostings
(
Collection<RawPostingListPtr>
postings, int32_t start, int32_t count);
37
virtual
void
flush
(MapTermsHashConsumerPerThreadCollectionTermsHashConsumerPerField threadsAndFields,
const
SegmentWriteStatePtr
& state);
38
virtual
void
closeDocStore
(
const
SegmentWriteStatePtr
& state);
39
40
TermVectorsTermsWriterPerDocPtr
getPerDoc
();
41
43
void
fill
(int32_t docID);
44
45
void
initTermVectorsWriter
();
46
void
finishDocument
(
const
TermVectorsTermsWriterPerDocPtr
& perDoc);
47
bool
freeRAM
();
48
void
free
(
const
TermVectorsTermsWriterPerDocPtr
& doc);
49
50
virtual
void
abort
();
51
virtual
int32_t
bytesPerPosting
();
52
};
53
54
class
TermVectorsTermsWriterPerDoc
:
public
DocWriter
{
55
public
:
56
TermVectorsTermsWriterPerDoc
(
const
TermVectorsTermsWriterPtr
& termsWriter =
TermVectorsTermsWriterPtr
());
57
virtual
~TermVectorsTermsWriterPerDoc
();
58
59
LUCENE_CLASS
(
TermVectorsTermsWriterPerDoc
);
60
61
protected
:
62
TermVectorsTermsWriterWeakPtr
_termsWriter
;
63
64
public
:
65
PerDocBufferPtr
buffer
;
66
RAMOutputStreamPtr
perDocTvf
;
67
int32_t
numVectorFields
;
68
69
Collection<int32_t>
fieldNumbers
;
70
Collection<int64_t>
fieldPointers
;
71
72
public
:
73
void
reset
();
74
virtual
void
abort
();
75
void
addField
(int32_t fieldNumber);
76
virtual
int64_t
sizeInBytes
();
77
virtual
void
finish
();
78
};
79
80
class
TermVectorsTermsWriterPostingList
:
public
RawPostingList
{
81
public
:
82
TermVectorsTermsWriterPostingList
();
83
virtual
~TermVectorsTermsWriterPostingList
();
84
85
LUCENE_CLASS
(
TermVectorsTermsWriterPostingList
);
86
87
public
:
88
int32_t
freq
;
// How many times this term occurred in the current doc
89
int32_t
lastOffset
;
// Last offset we saw
90
int32_t
lastPosition
;
// Last position where this term occurred
91
};
92
93
}
94
95
#endif
clucene.sourceforge.net