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
AbstractField.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 ABSTRACTFIELD_H
8 #define ABSTRACTFIELD_H
9
10 #include "Fieldable.h"
11
12 namespace Lucene
13 {
14 class LPPAPI AbstractField : public Fieldable, public LuceneObject
15 {
16 public:
18 enum Store
19 {
23 STORE_YES,
24
26 STORE_NO
27 };
28
30 enum Index
31 {
34 INDEX_NO,
35
38 INDEX_ANALYZED,
39
42 INDEX_NOT_ANALYZED,
43
51 INDEX_NOT_ANALYZED_NO_NORMS,
52
56 INDEX_ANALYZED_NO_NORMS
57 };
58
60 enum TermVector
61 {
63 TERM_VECTOR_NO,
64
67 TERM_VECTOR_YES,
68
71 TERM_VECTOR_WITH_POSITIONS,
72
75 TERM_VECTOR_WITH_OFFSETS,
76
81 TERM_VECTOR_WITH_POSITIONS_OFFSETS
82 };
83
84 public:
85 virtual ~AbstractField();
86
87 LUCENE_CLASS(AbstractField);
88
89 protected:
90 AbstractField();
91 AbstractField(const String& name, Store store, Index index, TermVector termVector);
92
93 String _name;
94 bool storeTermVector;
95 bool storeOffsetWithTermVector;
96 bool storePositionWithTermVector;
97 bool _omitNorms;
98 bool _isStored;
99 bool _isIndexed;
100 bool _isTokenized;
101 bool _isBinary;
102 bool lazy;
103 bool omitTermFreqAndPositions;
104 double boost;
105
106 // the data object for all different kind of field values
107 FieldsData fieldsData;
108
109 // pre-analyzed tokenStream for indexed fields
110 TokenStreamPtr tokenStream;
111
112 // length/offset for all primitive types
113 int32_t binaryLength;
114 int32_t binaryOffset;
115
116 public:
131 virtual void setBoost(double boost);
132
140 virtual double getBoost();
141
143 virtual String name();
144
147 virtual bool isStored();
148
150 virtual bool isIndexed();
151
154 virtual bool isTokenized();
155
160 virtual bool isTermVectorStored();
161
164 virtual bool isStoreOffsetWithTermVector();
165
167 virtual bool isStorePositionWithTermVector();
168
170 virtual bool isBinary();
171
175 virtual ByteArray getBinaryValue();
176
180 virtual ByteArray getBinaryValue(ByteArray result);
181
185 virtual int32_t getBinaryLength();
186
190 virtual int32_t getBinaryOffset();
191
193 virtual bool getOmitNorms();
194
196 virtual bool getOmitTermFreqAndPositions();
197
200 virtual void setOmitNorms(bool omitNorms);
201
207 virtual void setOmitTermFreqAndPositions(bool omitTermFreqAndPositions);
208
214 virtual bool isLazy();
215
217 virtual String toString();
218
219 protected:
220 void setStoreTermVector(TermVector termVector);
221 };
222 }
223
224 #endif

clucene.sourceforge.net