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


Loading...
Searching...
No Matches
NumericField.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 NUMERICFIELD_H
8#define NUMERICFIELD_H
9
10#include "Field.h"
11
12namespace Lucene {
13
59class LPPAPI NumericField : public AbstractField {
60public:
66 NumericField(const String& name);
67
76 NumericField(const String& name, Field::Store store, bool index);
77
83 NumericField(const String& name, int32_t precisionStep);
84
93 NumericField(const String& name, int32_t precisionStep, Field::Store store, bool index);
94
95 virtual ~NumericField();
96
98
99protected:
101
102public:
105
107 virtual ByteArray getBinaryValue(ByteArray result);
108
111
113 virtual String stringValue();
114
116 virtual int64_t getNumericValue();
117
120 virtual NumericFieldPtr setLongValue(int64_t value);
121
124 virtual NumericFieldPtr setIntValue(int32_t value);
125
128 virtual NumericFieldPtr setDoubleValue(double value);
129};
130
131}
132
133#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Definition AbstractField.h:14
Store
Specifies whether and how a field should be stored.
Definition AbstractField.h:17
This class provides a Field that enables indexing of numeric values for efficient range filtering and...
Definition NumericField.h:59
NumericTokenStreamPtr tokenStream
Definition NumericField.h:100
virtual int64_t getNumericValue()
Returns the current numeric value.
NumericField(const String &name)
Creates a field for numeric values using the default precisionStep NumericUtils#PRECISION_STEP_DEFAUL...
NumericField(const String &name, int32_t precisionStep, Field::Store store, bool index)
Creates a field for numeric values with the specified precisionStep. The instance is not yet initiali...
virtual NumericFieldPtr setLongValue(int64_t value)
Initializes the field with the supplied long value.
virtual TokenStreamPtr tokenStreamValue()
Returns a NumericTokenStream for indexing the numeric value.
virtual String stringValue()
Returns the numeric value as a string (how it is stored, when Field.Store#YES is chosen).
NumericField(const String &name, int32_t precisionStep)
Creates a field for numeric values with the specified precisionStep. The instance is not yet initiali...
virtual ReaderPtr readerValue()
Returns always null for numeric fields.
virtual NumericFieldPtr setIntValue(int32_t value)
Initializes the field with the supplied int value.
virtual NumericFieldPtr setDoubleValue(double value)
Initializes the field with the supplied double value.
virtual ByteArray getBinaryValue(ByteArray result)
Returns always null for numeric fields.
NumericField(const String &name, Field::Store store, bool index)
Creates a field for numeric values using the default precisionStep NumericUtils#PRECISION_STEP_DEFAUL...
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition LuceneTypes.h:63
boost::shared_ptr< NumericTokenStream > NumericTokenStreamPtr
Definition LuceneTypes.h:39
boost::shared_ptr< Reader > ReaderPtr
Definition LuceneTypes.h:547
boost::shared_ptr< NumericField > NumericFieldPtr
Definition LuceneTypes.h:81

clucene.sourceforge.net