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


FieldCacheRangeFilter.h
Go to the documentation of this file.
1 // 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 FIELDCACHERANGEFILTER_H
8 #define FIELDCACHERANGEFILTER_H
9 
10 #include "Filter.h"
11 #include "FieldCache.h"
12 
13 namespace Lucene {
14 
38 class LPPAPI FieldCacheRangeFilter : public Filter {
39 public:
40  FieldCacheRangeFilter(const String& field, const ParserPtr& parser, bool includeLower, bool includeUpper);
42 
44 
45 INTERNAL:
46  String field;
50 
51 public:
54  static FieldCacheRangeFilterPtr newStringRange(const String& field, const String& lowerVal, const String& upperVal, bool includeLower, bool includeUpper);
55 
59  static FieldCacheRangeFilterPtr newByteRange(const String& field, uint8_t lowerVal, uint8_t upperVal, bool includeLower, bool includeUpper);
60 
64  static FieldCacheRangeFilterPtr newByteRange(const String& field, const ByteParserPtr& parser, uint8_t lowerVal, uint8_t upperVal, bool includeLower, bool includeUpper);
65 
69  static FieldCacheRangeFilterPtr newIntRange(const String& field, int32_t lowerVal, int32_t upperVal, bool includeLower, bool includeUpper);
70 
74  static FieldCacheRangeFilterPtr newIntRange(const String& field, const IntParserPtr& parser, int32_t lowerVal, int32_t upperVal, bool includeLower, bool includeUpper);
75 
79  static FieldCacheRangeFilterPtr newLongRange(const String& field, int64_t lowerVal, int64_t upperVal, bool includeLower, bool includeUpper);
80 
84  static FieldCacheRangeFilterPtr newLongRange(const String& field, const LongParserPtr& parser, int64_t lowerVal, int64_t upperVal, bool includeLower, bool includeUpper);
85 
89  static FieldCacheRangeFilterPtr newDoubleRange(const String& field, double lowerVal, double upperVal, bool includeLower, bool includeUpper);
90 
94  static FieldCacheRangeFilterPtr newDoubleRange(const String& field, const DoubleParserPtr& parser, double lowerVal, double upperVal, bool includeLower, bool includeUpper);
95 
96  virtual String toString() = 0;
97  virtual bool equals(const LuceneObjectPtr& other) = 0;
98  virtual int32_t hashCode() = 0;
99 
101  virtual String getField();
102 
104  virtual bool includesLower();
105 
107  virtual bool includesUpper();
108 
110  virtual ParserPtr getParser();
111 };
112 
113 }
114 
115 #endif
Lucene::FieldCacheRangeFilter::newIntRange
static FieldCacheRangeFilterPtr newIntRange(const String &field, const IntParserPtr &parser, int32_t lowerVal, int32_t upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getInts(IndexReaderPtr, String, IntParserPtr)....
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::FieldCacheRangeFilter::hashCode
virtual int32_t hashCode()=0
Return hash code for this object.
Lucene::FieldCacheRangeFilter::includesUpper
virtual bool includesUpper()
Returns true if the upper endpoint is inclusive.
Lucene::FieldCacheRangeFilterPtr
boost::shared_ptr< FieldCacheRangeFilter > FieldCacheRangeFilterPtr
Definition: LuceneTypes.h:339
Lucene::FieldCacheRangeFilter::newLongRange
static FieldCacheRangeFilterPtr newLongRange(const String &field, const LongParserPtr &parser, int64_t lowerVal, int64_t upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getLongs(IndexReaderPtr, String, LongParserPtr)....
Lucene::FieldCacheRangeFilter::includeUpper
bool includeUpper
Definition: FieldCacheRangeFilter.h:49
Lucene::FieldCacheRangeFilter::newIntRange
static FieldCacheRangeFilterPtr newIntRange(const String &field, int32_t lowerVal, int32_t upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getInts(IndexReaderPtr, String). This works with all ...
Lucene::FieldCacheRangeFilter::newDoubleRange
static FieldCacheRangeFilterPtr newDoubleRange(const String &field, const DoubleParserPtr &parser, double lowerVal, double upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getDoubles(IndexReaderPtr, String,...
Lucene::FieldCacheRangeFilter
A range filter built on top of a cached single term field (in FieldCache).
Definition: FieldCacheRangeFilter.h:38
Lucene::FieldCacheRangeFilter::FieldCacheRangeFilter
FieldCacheRangeFilter(const String &field, const ParserPtr &parser, bool includeLower, bool includeUpper)
Lucene::FieldCacheRangeFilter::newStringRange
static FieldCacheRangeFilterPtr newStringRange(const String &field, const String &lowerVal, const String &upperVal, bool includeLower, bool includeUpper)
Creates a string range filter using FieldCache#getStringIndex. This works with all fields containing ...
Lucene::FieldCacheRangeFilter::toString
virtual String toString()=0
Returns a string representation of the object.
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::FieldCacheRangeFilter::equals
virtual bool equals(const LuceneObjectPtr &other)=0
Return whether two objects are equal.
Lucene::FieldCacheRangeFilter::includesLower
virtual bool includesLower()
Returns true if the lower endpoint is inclusive.
Lucene::DoubleParserPtr
boost::shared_ptr< DoubleParser > DoubleParserPtr
Definition: LuceneTypes.h:328
Lucene::LongParserPtr
boost::shared_ptr< LongParser > LongParserPtr
Definition: LuceneTypes.h:378
Lucene::FieldCacheRangeFilter::newDoubleRange
static FieldCacheRangeFilterPtr newDoubleRange(const String &field, double lowerVal, double upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getDoubles(IndexReaderPtr, String)....
Lucene::IntParserPtr
boost::shared_ptr< IntParser > IntParserPtr
Definition: LuceneTypes.h:376
Lucene::FieldCacheRangeFilter::getParser
virtual ParserPtr getParser()
Returns the current numeric parser.
Lucene::FieldCacheRangeFilter::newByteRange
static FieldCacheRangeFilterPtr newByteRange(const String &field, uint8_t lowerVal, uint8_t upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getBytes(IndexReaderPtr, String). This works with all...
FieldCache.h
Lucene::FieldCacheRangeFilter::includeLower
bool includeLower
Definition: FieldCacheRangeFilter.h:48
Lucene::Filter
Abstract base class for restricting which documents may be returned during searching.
Definition: Filter.h:15
Lucene::ByteParserPtr
boost::shared_ptr< ByteParser > ByteParserPtr
Definition: LuceneTypes.h:289
Lucene::ParserPtr
boost::shared_ptr< Parser > ParserPtr
Definition: LuceneTypes.h:401
Lucene::FieldCacheRangeFilter::parser
ParserPtr parser
Definition: FieldCacheRangeFilter.h:47
Lucene::FieldCacheRangeFilter::newLongRange
static FieldCacheRangeFilterPtr newLongRange(const String &field, int64_t lowerVal, int64_t upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getLongs(IndexReaderPtr, String). This works with all...
Lucene::FieldCacheRangeFilter::~FieldCacheRangeFilter
virtual ~FieldCacheRangeFilter()
Lucene::FieldCacheRangeFilter::newByteRange
static FieldCacheRangeFilterPtr newByteRange(const String &field, const ByteParserPtr &parser, uint8_t lowerVal, uint8_t upperVal, bool includeLower, bool includeUpper)
Creates a numeric range filter using FieldCache#getBytes(IndexReaderPtr, String, ByteParserPtr)....
Lucene::FieldCacheRangeFilter::getField
virtual String getField()
Returns the field name for this filter.
Filter.h

clucene.sourceforge.net