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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions
Lucene::FilteredQuery Class Reference

A query that applies a filter to the results of another query. More...

#include <FilteredQuery.h>

+ Inheritance diagram for Lucene::FilteredQuery:

Public Member Functions

 FilteredQuery (const QueryPtr &query, const FilterPtr &filter)
 Constructs a new query which applies a filter to the results of the original query. Filter::getDocIdSet() will be called every time this query is used in a search.
virtual ~FilteredQuery ()
virtual String getClassName ()
boost::shared_ptr< FilteredQueryshared_from_this ()
virtual WeightPtr createWeight (const SearcherPtr &searcher)
 Returns a Weight that applies the filter to the enclosed query's Weight. This is accomplished by overriding the Scorer returned by the Weight.
virtual QueryPtr rewrite (const IndexReaderPtr &reader)
 Rewrites the wrapped query.
QueryPtr getQuery ()
FilterPtr getFilter ()
virtual void extractTerms (SetTerm terms)
 Adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten form.
virtual String toString (const String &field)
 Prints a user-readable version of this query.
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
virtual int32_t hashCode ()
 Return hash code for this object.
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Returns a clone of this query.
- Public Member Functions inherited from Lucene::Query
 Query ()
virtual ~Query ()
virtual void setBoost (double b)
 Sets the boost for this query clause to b. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by b.
virtual double getBoost ()
 Gets the boost for this clause. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by b. The boost is 1.0 by default.
virtual String toString ()
 Prints a query to a string.
virtual WeightPtr weight (const SearcherPtr &searcher)
 Constructs and initializes a Weight for a top-level query.
virtual QueryPtr combine (Collection< QueryPtr > queries)
 Called when re-writing queries under MultiSearcher.
virtual SimilarityPtr getSimilarity (const SearcherPtr &searcher)
 Returns the Similarity implementation to be used for this query. Subclasses may override this method to specify their own Similarity implementation, perhaps one that delegates through that of the Searcher. By default the Searcher's Similarity implementation is returned.
String boostString ()
 Return given boost value as a string.
- 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 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 Public Member Functions inherited from Lucene::Query
static QueryPtr mergeBooleanQueries (Collection< BooleanQueryPtr > queries)
 Merges the clauses of a set of BooleanQuery's into a single BooleanQuery.

Additional Inherited Members

- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
- Protected Attributes inherited from Lucene::Query
double boost

Detailed Description

A query that applies a filter to the results of another query.

Note: the bits are retrieved from the filter each time this query is used in a search - use a CachingWrapperFilter to avoid regenerating the bits every time.

See Also
CachingWrapperFilter

Constructor & Destructor Documentation

Lucene::FilteredQuery::FilteredQuery ( const QueryPtr query,
const FilterPtr filter 
)

Constructs a new query which applies a filter to the results of the original query. Filter::getDocIdSet() will be called every time this query is used in a search.

Parameters
queryQuery to be filtered, cannot be null.
filterFilter to apply to query results, cannot be null.
virtual Lucene::FilteredQuery::~FilteredQuery ( )
virtual

Member Function Documentation

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

Reimplemented from Lucene::Query.

virtual LuceneObjectPtr Lucene::FilteredQuery::clone ( const LuceneObjectPtr other = LuceneObjectPtr())
virtual

Returns a clone of this query.

Reimplemented from Lucene::Query.

virtual WeightPtr Lucene::FilteredQuery::createWeight ( const SearcherPtr searcher)
virtual

Returns a Weight that applies the filter to the enclosed query's Weight. This is accomplished by overriding the Scorer returned by the Weight.

Reimplemented from Lucene::Query.

virtual bool Lucene::FilteredQuery::equals ( const LuceneObjectPtr other)
virtual

Return whether two objects are equal.

Reimplemented from Lucene::Query.

virtual void Lucene::FilteredQuery::extractTerms ( SetTerm  terms)
virtual

Adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten form.

Reimplemented from Lucene::Query.

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

Reimplemented from Lucene::Query.

FilterPtr Lucene::FilteredQuery::getFilter ( )
QueryPtr Lucene::FilteredQuery::getQuery ( )
virtual int32_t Lucene::FilteredQuery::hashCode ( )
virtual

Return hash code for this object.

Reimplemented from Lucene::Query.

virtual QueryPtr Lucene::FilteredQuery::rewrite ( const IndexReaderPtr reader)
virtual

Rewrites the wrapped query.

Reimplemented from Lucene::Query.

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

Reimplemented from Lucene::Query.

virtual String Lucene::FilteredQuery::toString ( const String &  field)
virtual

Prints a user-readable version of this query.

Reimplemented from Lucene::Query.


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

clucene.sourceforge.net