Lucene++ - a full-featured, c++ search engine
API Documentation


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AbstractField.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 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 public:
17  enum Store {
22 
24  STORE_NO
25  };
26 
28  enum Index {
32 
36 
40 
49 
53  INDEX_ANALYZED_NO_NORMS
54  };
55 
57  enum TermVector {
60 
64 
68 
72 
77  TERM_VECTOR_WITH_POSITIONS_OFFSETS
78  };
79 
80 public:
81  virtual ~AbstractField();
82 
84 
85 protected:
86  AbstractField();
87  AbstractField(const String& name, Store store, Index index, TermVector termVector);
88 
89  String _name;
93  bool _omitNorms;
94  bool _isStored;
95  bool _isIndexed;
97  bool _isBinary;
98  bool lazy;
100  double boost;
101 
102  // the data object for all different kind of field values
103  FieldsData fieldsData;
104 
105  // pre-analyzed tokenStream for indexed fields
107 
108  // length/offset for all primitive types
109  int32_t binaryLength;
110  int32_t binaryOffset;
111 
112 public:
127  virtual void setBoost(double boost);
128 
136  virtual double getBoost();
137 
139  virtual String name();
140 
143  virtual bool isStored();
144 
146  virtual bool isIndexed();
147 
150  virtual bool isTokenized();
151 
156  virtual bool isTermVectorStored();
157 
160  virtual bool isStoreOffsetWithTermVector();
161 
163  virtual bool isStorePositionWithTermVector();
164 
166  virtual bool isBinary();
167 
171  virtual ByteArray getBinaryValue();
172 
176  virtual ByteArray getBinaryValue(ByteArray result);
177 
181  virtual int32_t getBinaryLength();
182 
186  virtual int32_t getBinaryOffset();
187 
189  virtual bool getOmitNorms();
190 
192  virtual bool getOmitTermFreqAndPositions();
193 
196  virtual void setOmitNorms(bool omitNorms);
197 
203  virtual void setOmitTermFreqAndPositions(bool omitTermFreqAndPositions);
204 
210  virtual bool isLazy();
211 
213  virtual String toString();
214 
215 protected:
216  void setStoreTermVector(TermVector termVector);
217 };
218 
219 }
220 
221 #endif

clucene.sourceforge.net