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 // 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 FIELD_H
8 #define FIELD_H
9 
10 #include "AbstractField.h"
11 
12 namespace Lucene
13 {
14  class LPPAPI Field : public AbstractField
15  {
16  public:
24  Field(const String& name, const String& value, Store store, Index index);
25 
33  Field(const String& name, const String& value, Store store, Index index, TermVector termVector);
34 
41  Field(const String& name, ReaderPtr reader);
42 
50  Field(const String& name, ReaderPtr reader, TermVector termVector);
51 
58  Field(const String& name, TokenStreamPtr tokenStream);
59 
67  Field(const String& name, TokenStreamPtr tokenStream, TermVector termVector);
68 
74  Field(const String& name, ByteArray value, Store store);
75 
83  Field(const String& name, ByteArray value, int32_t offset, int32_t length, Store store);
84 
85  virtual ~Field();
86 
88 
89  public:
92 
94  static bool isStored(Store store);
95 
97  static bool isIndexed(Index index);
98  static bool isAnalyzed(Index index);
99  static bool omitNorms(Index index);
100 
102  static Field::Index toIndex(bool indexed, bool analyzed);
103 
105  static Field::Index toIndex(bool indexed, bool analyzed, bool omitNorms);
106 
108  static bool isStored(TermVector termVector);
109  static bool withPositions(TermVector termVector);
110  static bool withOffsets(TermVector termVector);
111 
113  static Field::TermVector toTermVector(bool stored, bool withOffsets, bool withPositions);
114 
117  virtual String stringValue();
118 
121  virtual ReaderPtr readerValue();
122 
125  virtual TokenStreamPtr tokenStreamValue();
126 
132  virtual void setValue(const String& value);
133 
135  virtual void setValue(ReaderPtr value);
136 
138  virtual void setValue(ByteArray value);
139 
141  virtual void setValue(ByteArray value, int32_t offset, int32_t length);
142 
145  virtual void setTokenStream(TokenStreamPtr tokenStream);
146 
147  protected:
148  void ConstructField(const String& name, const String& value, Store store, Index index, TermVector termVector);
149  void ConstructField(const String& name, ReaderPtr reader, TermVector termVector);
150  void ConstructField(const String& name, TokenStreamPtr tokenStream, TermVector termVector);
151  void ConstructField(const String& name, ByteArray value, int32_t offset, int32_t length, Store store);
152  };
153 }
154 
155 #endif

clucene.sourceforge.net