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

Loading...
Searching...
No Matches
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 {
21 STORE_YES,
22
24 STORE_NO
25 };
26
28 enum Index {
31 INDEX_NO,
32
35 INDEX_ANALYZED,
36
39 INDEX_NOT_ANALYZED,
40
48 INDEX_NOT_ANALYZED_NO_NORMS,
49
53 INDEX_ANALYZED_NO_NORMS
54 };
55
57 enum TermVector {
59 TERM_VECTOR_NO,
60
63 TERM_VECTOR_YES,
64
67 TERM_VECTOR_WITH_POSITIONS,
68
71 TERM_VECTOR_WITH_OFFSETS,
72
77 TERM_VECTOR_WITH_POSITIONS_OFFSETS
78 };
79
80 public:
81 virtual ~AbstractField();
82
83 LUCENE_CLASS(AbstractField);
84
85 protected:
86 AbstractField();
87 AbstractField(const String& name, Store store, Index index, TermVector termVector);
88
89 String _name;
90 bool storeTermVector;
91 bool storeOffsetWithTermVector;
92 bool storePositionWithTermVector;
93 bool _omitNorms;
94 bool _isStored;
95 bool _isIndexed;
96 bool _isTokenized;
97 bool _isBinary;
98 bool lazy;
99 bool omitTermFreqAndPositions;
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
106 TokenStreamPtr tokenStream;
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
Fieldable.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::AbstractField
Definition AbstractField.h:14
Lucene::AbstractField::isStorePositionWithTermVector
virtual bool isStorePositionWithTermVector()
True if terms are stored as term vector together with their token positions.
Lucene::AbstractField::omitTermFreqAndPositions
bool omitTermFreqAndPositions
Definition AbstractField.h:99
Lucene::AbstractField::_name
String _name
Definition AbstractField.h:89
Lucene::AbstractField::binaryLength
int32_t binaryLength
Definition AbstractField.h:109
Lucene::AbstractField::isStoreOffsetWithTermVector
virtual bool isStoreOffsetWithTermVector()
True if terms are stored as term vector together with their offsets (start and end position in source...
Lucene::AbstractField::storeTermVector
bool storeTermVector
Definition AbstractField.h:90
Lucene::AbstractField::isStored
virtual bool isStored()
True if the value of the field is to be stored in the index for return with search hits....
Lucene::AbstractField::getBinaryLength
virtual int32_t getBinaryLength()
Returns length of byte[] segment that is used as value, if Field is not binary returned value is unde...
Lucene::AbstractField::isLazy
virtual bool isLazy()
Indicates whether a Field is Lazy or not. The semantics of Lazy loading are such that if a Field is l...
Lucene::AbstractField::_isTokenized
bool _isTokenized
Definition AbstractField.h:96
Lucene::AbstractField::tokenStream
TokenStreamPtr tokenStream
Definition AbstractField.h:106
Lucene::AbstractField::isTermVectorStored
virtual bool isTermVectorStored()
True if the term or terms used to index this field are stored as a term vector, available from IndexR...
Lucene::AbstractField::setOmitTermFreqAndPositions
virtual void setOmitTermFreqAndPositions(bool omitTermFreqAndPositions)
If set, omit term freq, positions and payloads from postings for this field.
Lucene::AbstractField::isTokenized
virtual bool isTokenized()
True if the value of the field should be tokenized as text prior to indexing. Un-tokenized fields are...
Lucene::AbstractField::_isIndexed
bool _isIndexed
Definition AbstractField.h:95
Lucene::AbstractField::isIndexed
virtual bool isIndexed()
True if the value of the field is to be indexed, so that it may be searched on.
Lucene::AbstractField::fieldsData
FieldsData fieldsData
Definition AbstractField.h:103
Lucene::AbstractField::setBoost
virtual void setBoost(double boost)
Sets the boost factor hits on this field. This value will be multiplied into the score of all hits on...
Lucene::AbstractField::_isStored
bool _isStored
Definition AbstractField.h:94
Lucene::AbstractField::toString
virtual String toString()
Prints a Field for human consumption.
Lucene::AbstractField::getOmitNorms
virtual bool getOmitNorms()
True if norms are omitted for this indexed field.
Lucene::AbstractField::getBoost
virtual double getBoost()
Returns the boost factor for hits for this field.
Lucene::AbstractField::_isBinary
bool _isBinary
Definition AbstractField.h:97
Lucene::AbstractField::isBinary
virtual bool isBinary()
True if the value of the field is stored as binary.
Lucene::AbstractField::getBinaryOffset
virtual int32_t getBinaryOffset()
Returns offset into byte[] segment that is used as value, if Field is not binary returned value is un...
Lucene::AbstractField::boost
double boost
Definition AbstractField.h:100
Lucene::AbstractField::storeOffsetWithTermVector
bool storeOffsetWithTermVector
Definition AbstractField.h:91
Lucene::AbstractField::getOmitTermFreqAndPositions
virtual bool getOmitTermFreqAndPositions()
Lucene::AbstractField::getBinaryValue
virtual ByteArray getBinaryValue(ByteArray result)
Return the raw byte[] for the binary field. Note that you must also call getBinaryLength and getBinar...
Lucene::AbstractField::setOmitNorms
virtual void setOmitNorms(bool omitNorms)
If set, omit normalization factors associated with this indexed field. This effectively disables inde...
Lucene::AbstractField::getBinaryValue
virtual ByteArray getBinaryValue()
Return the raw byte[] for the binary field. Note that you must also call getBinaryLength and getBinar...
Lucene::AbstractField::binaryOffset
int32_t binaryOffset
Definition AbstractField.h:110
Lucene::AbstractField::_omitNorms
bool _omitNorms
Definition AbstractField.h:93
Lucene::AbstractField::lazy
bool lazy
Definition AbstractField.h:98
Lucene::AbstractField::Store
Store
Specifies whether and how a field should be stored.
Definition AbstractField.h:17
Lucene::AbstractField::STORE_YES
@ STORE_YES
Store the original field value in the index. This is useful for short texts like a document's title w...
Definition AbstractField.h:21
Lucene::AbstractField::storePositionWithTermVector
bool storePositionWithTermVector
Definition AbstractField.h:92
Lucene::AbstractField::setStoreTermVector
void setStoreTermVector(TermVector termVector)
Lucene::AbstractField::AbstractField
AbstractField()
Lucene::AbstractField::Index
Index
Specifies whether and how a field should be indexed.
Definition AbstractField.h:28
Lucene::AbstractField::INDEX_NOT_ANALYZED
@ INDEX_NOT_ANALYZED
Index the field's value without using an Analyzer, so it can be searched. As no analyzer is used the ...
Definition AbstractField.h:39
Lucene::AbstractField::INDEX_NO
@ INDEX_NO
Do not index the field value. This field can thus not be searched, but one can still access its conte...
Definition AbstractField.h:31
Lucene::AbstractField::INDEX_ANALYZED
@ INDEX_ANALYZED
Index the tokens produced by running the field's value through an Analyzer. This is useful for common...
Definition AbstractField.h:35
Lucene::AbstractField::INDEX_NOT_ANALYZED_NO_NORMS
@ INDEX_NOT_ANALYZED_NO_NORMS
Index the field's value without an Analyzer, and also disable the storing of norms....
Definition AbstractField.h:48
Lucene::AbstractField::name
virtual String name()
Returns the name of the field as an interned string. For example "date", "title", "body",...
Lucene::AbstractField::TermVector
TermVector
Specifies whether and how a field should have term vectors.
Definition AbstractField.h:57
Lucene::AbstractField::TERM_VECTOR_WITH_POSITIONS
@ TERM_VECTOR_WITH_POSITIONS
Store the term vector + token position information.
Definition AbstractField.h:67
Lucene::AbstractField::TERM_VECTOR_YES
@ TERM_VECTOR_YES
Store the term vectors of each document. A term vector is a list of the document's terms and their nu...
Definition AbstractField.h:63
Lucene::AbstractField::TERM_VECTOR_WITH_OFFSETS
@ TERM_VECTOR_WITH_OFFSETS
Store the term vector + token offset information.
Definition AbstractField.h:71
Lucene::AbstractField::TERM_VECTOR_NO
@ TERM_VECTOR_NO
Do not store term vectors.
Definition AbstractField.h:59
Lucene::AbstractField::~AbstractField
virtual ~AbstractField()
Lucene::AbstractField::AbstractField
AbstractField(const String &name, Store store, Index index, TermVector termVector)
Lucene::Fieldable
Synonymous with Field.
Definition Fieldable.h:20
Lucene::LuceneObject
Base class for all Lucene classes.
Definition LuceneObject.h:31
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::TokenStreamPtr
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition LuceneTypes.h:63

clucene.sourceforge.net