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

Loading...
Searching...
No Matches
TermRangeQuery.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 TERMRANGEQUERY_H
8#define TERMRANGEQUERY_H
9
10#include "MultiTermQuery.h"
11
12 namespace Lucene {
13
21 class LPPAPI TermRangeQuery : public MultiTermQuery {
22 public:
42 TermRangeQuery(const String& fieldName, StringValue lowerTerm, StringValue upperTerm, bool includeLower,
43 bool includeUpper, CollatorPtr collator = CollatorPtr());
44
45 virtual ~TermRangeQuery();
46
47 LUCENE_CLASS(TermRangeQuery);
48
49 protected:
50 StringValue lowerTerm;
51 StringValue upperTerm;
52 CollatorPtr collator;
53 String field;
54 bool includeLower;
55 bool includeUpper;
56
57 public:
58 using MultiTermQuery::toString;
59
61 String getField();
62
64 String getLowerTerm();
65
67 String getUpperTerm();
68
70 bool includesLower();
71
73 bool includesUpper();
74
76 CollatorPtr getCollator();
77
78 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
79 virtual String toString(const String& field);
80 virtual int32_t hashCode();
81 virtual bool equals(const LuceneObjectPtr& other);
82
83 protected:
84 virtual FilteredTermEnumPtr getEnum(const IndexReaderPtr& reader);
85};
86
87}
88
89#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
MultiTermQuery.h
Lucene::MultiTermQuery
An abstract Query that matches documents containing a subset of terms provided by a FilteredTermEnum ...
Definition MultiTermQuery.h:31
Lucene::TermRangeQuery
A Query that matches documents within an range of terms.
Definition TermRangeQuery.h:21
Lucene::TermRangeQuery::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::TermRangeQuery::includesLower
bool includesLower()
Returns true if the lower endpoint is inclusive.
Lucene::TermRangeQuery::field
String field
Definition TermRangeQuery.h:53
Lucene::TermRangeQuery::upperTerm
StringValue upperTerm
Definition TermRangeQuery.h:51
Lucene::TermRangeQuery::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this query.
Lucene::TermRangeQuery::includesUpper
bool includesUpper()
Returns true if the upper endpoint is inclusive.
Lucene::TermRangeQuery::getEnum
virtual FilteredTermEnumPtr getEnum(const IndexReaderPtr &reader)
Construct the enumeration to be used, expanding the pattern term.
Lucene::TermRangeQuery::includeUpper
bool includeUpper
Definition TermRangeQuery.h:55
Lucene::TermRangeQuery::getField
String getField()
Returns the field name for this query.
Lucene::TermRangeQuery::lowerTerm
StringValue lowerTerm
Definition TermRangeQuery.h:50
Lucene::TermRangeQuery::getLowerTerm
String getLowerTerm()
Returns the lower value of this range query.
Lucene::TermRangeQuery::TermRangeQuery
TermRangeQuery(const String &fieldName, StringValue lowerTerm, StringValue upperTerm, bool includeLower, bool includeUpper, CollatorPtr collator=CollatorPtr())
Constructs a query selecting all terms greater/equal than lowerTerm but less/equal than upperTerm.
Lucene::TermRangeQuery::getCollator
CollatorPtr getCollator()
Returns the collator used to determine range inclusion, if any.
Lucene::TermRangeQuery::~TermRangeQuery
virtual ~TermRangeQuery()
Lucene::TermRangeQuery::collator
CollatorPtr collator
Definition TermRangeQuery.h:52
Lucene::TermRangeQuery::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::TermRangeQuery::getUpperTerm
String getUpperTerm()
Returns the upper value of this range query.
Lucene::TermRangeQuery::toString
virtual String toString(const String &field)
Prints a query to a string, with field assumed to be the default field and omitted.
Lucene::TermRangeQuery::includeLower
bool includeLower
Definition TermRangeQuery.h:54
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
Lucene::CollatorPtr
boost::shared_ptr< Collator > CollatorPtr
Definition LuceneTypes.h:525
Lucene::IndexReaderPtr
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition LuceneTypes.h:157
Lucene::FilteredTermEnumPtr
boost::shared_ptr< FilteredTermEnum > FilteredTermEnumPtr
Definition LuceneTypes.h:365

clucene.sourceforge.net