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


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
Lucene::TermRangeFilter Class Reference

A Filter that restricts search results to a range of term values in a given field. More...

#include <TermRangeFilter.h>

+ Inheritance diagram for Lucene::TermRangeFilter:

Public Member Functions

 TermRangeFilter (const String &fieldName, StringValue lowerTerm, StringValue upperTerm, bool includeLower, bool includeUpper, CollatorPtr collator=CollatorPtr())
 Warning: Using this constructor and supplying a non-null value in the collator parameter will cause every single index Term in the Field referenced by lowerTerm and/or upperTerm to be examined. Depending on the number of index Terms in this Field, the operation could be very slow.
 
virtual ~TermRangeFilter ()
 
virtual String getClassName ()
 
boost::shared_ptr< TermRangeFiltershared_from_this ()
 
String getField ()
 Returns the field name for this filter.
 
String getLowerTerm ()
 Returns the lower value of this range filter.
 
String getUpperTerm ()
 Returns the upper value of this range filter.
 
bool includesLower ()
 Returns true if the lower endpoint is inclusive.
 
bool includesUpper ()
 Returns true if the upper endpoint is inclusive.
 
CollatorPtr getCollator ()
 Returns the collator used to determine range inclusion, if any.
 
- Public Member Functions inherited from Lucene::MultiTermQueryWrapperFilter
virtual ~MultiTermQueryWrapperFilter ()
 
boost::shared_ptr< MultiTermQueryWrapperFiltershared_from_this ()
 
virtual String toString ()
 Returns a string representation of the object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
int32_t getTotalNumberOfTerms ()
 Return the number of unique terms visited during execution of the filter. If there are many of them, you may consider using another filter type or optimize your total term count in index.
 
void clearTotalNumberOfTerms ()
 Resets the counting of unique terms. Do this before executing the filter.
 
virtual DocIdSetPtr getDocIdSet (const IndexReaderPtr &reader)
 Returns a DocIdSet with documents that should be permitted in search results.
 
- Public Member Functions inherited from Lucene::Filter
virtual ~Filter ()
 
boost::shared_ptr< Filtershared_from_this ()
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

Static Public Member Functions

static String _getClassName ()
 
static TermRangeFilterPtr Less (const String &fieldName, StringValue upperTerm)
 Constructs a filter for field fieldName matching less than or equal to upperTerm.
 
static TermRangeFilterPtr More (const String &fieldName, StringValue lowerTerm)
 Constructs a filter for field fieldName matching greater than or equal to lowerTerm.
 
- Static Public Member Functions inherited from Lucene::MultiTermQueryWrapperFilter
static String _getClassName ()
 
- Static Public Member Functions inherited from Lucene::Filter
static String _getClassName ()
 

Additional Inherited Members

- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 
- Protected Attributes inherited from Lucene::MultiTermQueryWrapperFilter
MultiTermQueryPtr query
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

A Filter that restricts search results to a range of term values in a given field.

This filter matches the documents looking for terms that fall into the supplied range according to String#compare(String), unless a Collator is provided. It is not intended for numerical ranges; use NumericRangeFilter instead.

If you construct a large number of range filters with different ranges but on the same field, FieldCacheRangeFilter may have significantly better performance.

Constructor & Destructor Documentation

◆ TermRangeFilter()

Lucene::TermRangeFilter::TermRangeFilter ( const String &  fieldName,
StringValue  lowerTerm,
StringValue  upperTerm,
bool  includeLower,
bool  includeUpper,
CollatorPtr  collator = CollatorPtr() 
)

Warning: Using this constructor and supplying a non-null value in the collator parameter will cause every single index Term in the Field referenced by lowerTerm and/or upperTerm to be examined. Depending on the number of index Terms in this Field, the operation could be very slow.

Parameters
lowerTermThe lower bound on this range
upperTermThe upper bound on this range
includeLowerDoes this range include the lower bound?
includeUpperDoes this range include the upper bound?
collatorThe collator to use when determining range inclusion; set to null to use Unicode code point ordering instead of collation.

◆ ~TermRangeFilter()

virtual Lucene::TermRangeFilter::~TermRangeFilter ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::TermRangeFilter::_getClassName ( )
inlinestatic

◆ getClassName()

virtual String Lucene::TermRangeFilter::getClassName ( )
inlinevirtual

◆ getCollator()

CollatorPtr Lucene::TermRangeFilter::getCollator ( )

Returns the collator used to determine range inclusion, if any.

◆ getField()

String Lucene::TermRangeFilter::getField ( )

Returns the field name for this filter.

◆ getLowerTerm()

String Lucene::TermRangeFilter::getLowerTerm ( )

Returns the lower value of this range filter.

◆ getUpperTerm()

String Lucene::TermRangeFilter::getUpperTerm ( )

Returns the upper value of this range filter.

◆ includesLower()

bool Lucene::TermRangeFilter::includesLower ( )

Returns true if the lower endpoint is inclusive.

◆ includesUpper()

bool Lucene::TermRangeFilter::includesUpper ( )

Returns true if the upper endpoint is inclusive.

◆ Less()

static TermRangeFilterPtr Lucene::TermRangeFilter::Less ( const String &  fieldName,
StringValue  upperTerm 
)
static

Constructs a filter for field fieldName matching less than or equal to upperTerm.

◆ More()

static TermRangeFilterPtr Lucene::TermRangeFilter::More ( const String &  fieldName,
StringValue  lowerTerm 
)
static

Constructs a filter for field fieldName matching greater than or equal to lowerTerm.

◆ shared_from_this()

boost::shared_ptr< TermRangeFilter > Lucene::TermRangeFilter::shared_from_this ( )
inline

The documentation for this class was generated from the following file:

clucene.sourceforge.net