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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Field.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 FIELD_H
8 #define FIELD_H
9 
10 #include "AbstractField.h"
11 
12 namespace Lucene {
13 
14 class LPPAPI Field : public AbstractField {
15 public:
23  Field(const String& name, const String& value, Store store, Index index);
24 
32  Field(const String& name, const String& value, Store store, Index index, TermVector termVector);
33 
40  Field(const String& name, const ReaderPtr& reader);
41 
49  Field(const String& name, const ReaderPtr& reader, TermVector termVector);
50 
57  Field(const String& name, const TokenStreamPtr& tokenStream);
58 
66  Field(const String& name, const TokenStreamPtr& tokenStream, TermVector termVector);
67 
73  Field(const String& name, ByteArray value, Store store);
74 
82  Field(const String& name, ByteArray value, int32_t offset, int32_t length, Store store);
83 
84  virtual ~Field();
85 
87 
88 public:
91 
93  static bool isStored(Store store);
94 
96  static bool isIndexed(Index index);
97  static bool isAnalyzed(Index index);
98  static bool omitNorms(Index index);
99 
101  static Field::Index toIndex(bool indexed, bool analyzed);
102 
104  static Field::Index toIndex(bool indexed, bool analyzed, bool omitNorms);
105 
107  static bool isStored(TermVector termVector);
108  static bool withPositions(TermVector termVector);
109  static bool withOffsets(TermVector termVector);
110 
112  static Field::TermVector toTermVector(bool stored, bool withOffsets, bool withPositions);
113 
116  virtual String stringValue();
117 
120  virtual ReaderPtr readerValue();
121 
124  virtual TokenStreamPtr tokenStreamValue();
125 
131  virtual void setValue(const String& value);
132 
134  virtual void setValue(const ReaderPtr& value);
135 
137  virtual void setValue(ByteArray value);
138 
140  virtual void setValue(ByteArray value, int32_t offset, int32_t length);
141 
144  virtual void setTokenStream(const TokenStreamPtr& tokenStream);
145 
146 protected:
147  void ConstructField(const String& name, const String& value, Store store, Index index, TermVector termVector);
148  void ConstructField(const String& name, const ReaderPtr& reader, TermVector termVector);
149  void ConstructField(const String& name, const TokenStreamPtr& tokenStream, TermVector termVector);
150  void ConstructField(const String& name, ByteArray value, int32_t offset, int32_t length, Store store);
151 };
152 
153 }
154 
155 #endif

clucene.sourceforge.net