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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
NumericRangeQuery.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 NUMERICRANGEQUERY_H
8 #define NUMERICRANGEQUERY_H
9
10 #include "MultiTermQuery.h"
11 #include "FilteredTermEnum.h"
12 #include "NumericUtils.h"
13
14 namespace Lucene
15 {
108 class LPPAPI NumericRangeQuery : public MultiTermQuery
109 {
110 public:
111 NumericRangeQuery(const String& field, int32_t precisionStep, int32_t valSize, NumericValue min, NumericValue max, bool minInclusive, bool maxInclusive);
112 virtual ~NumericRangeQuery();
113
114 LUCENE_CLASS(NumericRangeQuery);
115
116 INTERNAL:
117 String field;
118 int32_t precisionStep;
119 int32_t valSize;
120 NumericValue min;
121 NumericValue max;
122 bool minInclusive;
123 bool maxInclusive;
124
125 public:
126 using MultiTermQuery::toString;
127
129 static NumericRangeQueryPtr newLongRange(const String& field, int32_t precisionStep, int64_t min, int64_t max, bool minInclusive, bool maxInclusive);
130
133 static NumericRangeQueryPtr newLongRange(const String& field, int64_t min, int64_t max, bool minInclusive, bool maxInclusive);
134
136 static NumericRangeQueryPtr newIntRange(const String& field, int32_t precisionStep, int32_t min, int32_t max, bool minInclusive, bool maxInclusive);
137
140 static NumericRangeQueryPtr newIntRange(const String& field, int32_t min, int32_t max, bool minInclusive, bool maxInclusive);
141
143 static NumericRangeQueryPtr newDoubleRange(const String& field, int32_t precisionStep, double min, double max, bool minInclusive, bool maxInclusive);
144
147 static NumericRangeQueryPtr newDoubleRange(const String& field, double min, double max, bool minInclusive, bool maxInclusive);
148
153 static NumericRangeQueryPtr newNumericRange(const String& field, int32_t precisionStep, NumericValue min, NumericValue max, bool minInclusive, bool maxInclusive);
154
160 static NumericRangeQueryPtr newNumericRange(const String& field, NumericValue min, NumericValue max, bool minInclusive, bool maxInclusive);
161
163 String getField();
164
166 bool includesMin();
167
169 bool includesMax();
170
172 NumericValue getMin();
173
175 NumericValue getMax();
176
177 virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr());
178 virtual String toString(const String& field);
179 virtual bool equals(LuceneObjectPtr other);
180 virtual int32_t hashCode();
181
182 protected:
183 virtual FilteredTermEnumPtr getEnum(IndexReaderPtr reader);
184
185 friend class NumericRangeTermEnum;
186 };
187 }
188
189 #endif

clucene.sourceforge.net