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
TermInfosWriter.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 TERMINFOSWRITER_H
8
#define TERMINFOSWRITER_H
9
10
#include "
LuceneObject.h
"
11
12
namespace
Lucene {
13
16
class
TermInfosWriter
:
public
LuceneObject
{
17
public
:
18
TermInfosWriter
(
const
DirectoryPtr
& directory,
const
String& segment,
const
FieldInfosPtr
& fis, int32_t interval);
19
TermInfosWriter
(
const
DirectoryPtr
& directory,
const
String& segment,
const
FieldInfosPtr
& fis, int32_t interval,
bool
isIndex
);
20
virtual
~TermInfosWriter
();
21
22
LUCENE_CLASS
(
TermInfosWriter
);
23
24
public
:
26
static
const
int32_t
FORMAT
;
27
29
static
const
int32_t
FORMAT_VERSION_UTF8_LENGTH_IN_BYTES
;
30
32
static
const
int32_t
FORMAT_CURRENT
;
33
37
int32_t
indexInterval
;
38
43
int32_t
skipInterval
;
44
47
int32_t
maxSkipLevels
;
48
49
protected
:
50
FieldInfosPtr
fieldInfos
;
51
IndexOutputPtr
output
;
52
TermInfoPtr
lastTi
;
53
int64_t
size
;
54
55
int64_t
lastIndexPointer
;
56
bool
isIndex
;
57
ByteArray
lastTermBytes
;
58
int32_t
lastTermBytesLength
;
59
int32_t
lastFieldNumber
;
60
61
TermInfosWriterPtr
otherWriter
;
62
TermInfosWriterWeakPtr
_other
;
63
UTF8ResultPtr
utf8Result
;
64
65
// Currently used only by assert statements
66
UnicodeResultPtr
unicodeResult1
;
67
UnicodeResultPtr
unicodeResult2
;
68
69
public
:
70
virtual
void
initialize
();
71
72
void
add
(
const
TermPtr
& term,
const
TermInfoPtr
& ti);
73
76
void
add
(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength,
const
TermInfoPtr
& ti);
77
79
void
close
();
80
81
protected
:
82
void
initialize
(
const
DirectoryPtr
& directory,
const
String& segment,
const
FieldInfosPtr
& fis, int32_t interval,
bool
isi);
83
85
bool
initUnicodeResults
();
86
88
int32_t
compareToLastTerm
(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength);
89
90
void
writeTerm
(int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength);
91
};
92
93
}
94
95
#endif
clucene.sourceforge.net