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
12 namespace Lucene {
13
59 class LPPAPI NumericField : public AbstractField {
60 public:
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
97 LUCENE_CLASS(NumericField);
98
99 protected:
100 NumericTokenStreamPtr tokenStream;
101
102 public:
104 virtual TokenStreamPtr tokenStreamValue();
105
107 virtual ByteArray getBinaryValue(ByteArray result);
108
110 virtual ReaderPtr readerValue();
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
Field.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::AbstractField::Store
Store
Specifies whether and how a field should be stored.
Definition AbstractField.h:17
Lucene::AbstractField::AbstractField
AbstractField()
Lucene::AbstractField::name
virtual String name()
Returns the name of the field as an interned string. For example "date", "title", "body",...
Lucene::NumericField::tokenStream
NumericTokenStreamPtr tokenStream
Definition NumericField.h:100
Lucene::NumericField::getNumericValue
virtual int64_t getNumericValue()
Returns the current numeric value.
Lucene::NumericField::NumericField
NumericField(const String &name)
Creates a field for numeric values using the default precisionStep NumericUtils#PRECISION_STEP_DEFAUL...
Lucene::NumericField::NumericField
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...
Lucene::NumericField::setLongValue
virtual NumericFieldPtr setLongValue(int64_t value)
Initializes the field with the supplied long value.
Lucene::NumericField::tokenStreamValue
virtual TokenStreamPtr tokenStreamValue()
Returns a NumericTokenStream for indexing the numeric value.
Lucene::NumericField::stringValue
virtual String stringValue()
Returns the numeric value as a string (how it is stored, when Field.Store#YES is chosen).
Lucene::NumericField::~NumericField
virtual ~NumericField()
Lucene::NumericField::NumericField
NumericField(const String &name, int32_t precisionStep)
Creates a field for numeric values with the specified precisionStep. The instance is not yet initiali...
Lucene::NumericField::readerValue
virtual ReaderPtr readerValue()
Returns always null for numeric fields.
Lucene::NumericField::setIntValue
virtual NumericFieldPtr setIntValue(int32_t value)
Initializes the field with the supplied int value.
Lucene::NumericField::setDoubleValue
virtual NumericFieldPtr setDoubleValue(double value)
Initializes the field with the supplied double value.
Lucene::NumericField::getBinaryValue
virtual ByteArray getBinaryValue(ByteArray result)
Returns always null for numeric fields.
Lucene::NumericField::NumericField
NumericField(const String &name, Field::Store store, bool index)
Creates a field for numeric values using the default precisionStep NumericUtils#PRECISION_STEP_DEFAUL...
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::TokenStreamPtr
boost::shared_ptr< TokenStream > TokenStreamPtr
Definition LuceneTypes.h:63
Lucene::ReaderPtr
boost::shared_ptr< Reader > ReaderPtr
Definition LuceneTypes.h:547
Lucene::NumericTokenStreamPtr
boost::shared_ptr< NumericTokenStream > NumericTokenStreamPtr
Definition LuceneTypes.h:39
Lucene::NumericFieldPtr
boost::shared_ptr< NumericField > NumericFieldPtr
Definition LuceneTypes.h:81

clucene.sourceforge.net