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

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes
Lucene::ConstantScoreQuery Class Reference

A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter. More...

`#include <ConstantScoreQuery.h>`

Inheritance diagram for Lucene::ConstantScoreQuery:

## Public Member Functions

| ConstantScoreQuery (const FilterPtr &filter)
virtual | ~ConstantScoreQuery ()
virtual String | getClassName ()
boost::shared_ptr< ConstantScoreQuery > | shared_from_this ()
FilterPtr | getFilter ()
| Returns the encapsulated filter.
virtual QueryPtr | rewrite (const IndexReaderPtr &reader)
| Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
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 WeightPtr | createWeight (const SearcherPtr &searcher)
| Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries, which re-write to themselves.
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.
virtual String | toString ()
| Prints a query to a string.
Public Member Functions inherited from Lucene::Query
| Query ()
virtual | ~Query ()
boost::shared_ptr< Query > | shared_from_this ()
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 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 String | _getClassName ()
static QueryPtr | mergeBooleanQueries (Collection< BooleanQueryPtr > queries)
| Merges the clauses of a set of BooleanQuery's into a single BooleanQuery.

## Protected Attributes

FilterPtr | filter
Protected Attributes inherited from Lucene::Query
double | boost
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Additional Inherited Members

Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Detailed Description

A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.

## Constructor & Destructor Documentation

## ◆ ConstantScoreQuery()

Lucene::ConstantScoreQuery::ConstantScoreQuery | ( | const FilterPtr & | filter | ) |

References filter.

Referenced by _getClassName().

## ◆ ~ConstantScoreQuery()

virtual Lucene::ConstantScoreQuery::~ConstantScoreQuery | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

String Lucene::ConstantScoreQuery::_getClassName | ( |  | ) |

inline static

References ConstantScoreQuery().

## ◆ clone()

virtual LuceneObjectPtr Lucene::ConstantScoreQuery::clone | ( | const LuceneObjectPtr & | other = LuceneObjectPtr() | ) |

virtual

Returns a clone of this query.

Reimplemented from Lucene::Query.

## ◆ createWeight()

virtual WeightPtr Lucene::ConstantScoreQuery::createWeight | ( | const SearcherPtr & | searcher | ) |

virtual

Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries, which re-write to themselves.

Reimplemented from Lucene::Query.

## ◆ equals()

virtual bool Lucene::ConstantScoreQuery::equals | ( | const LuceneObjectPtr & | other | ) |

virtual

Return whether two objects are equal.

Reimplemented from Lucene::Query.

## ◆ extractTerms()

virtual void Lucene::ConstantScoreQuery::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.

## ◆ getClassName()

virtual String Lucene::ConstantScoreQuery::getClassName | ( |  | ) |

inline virtual

Reimplemented from Lucene::Query.

## ◆ getFilter()

FilterPtr Lucene::ConstantScoreQuery::getFilter | ( |  | ) |

Returns the encapsulated filter.

## ◆ hashCode()

virtual int32_t Lucene::ConstantScoreQuery::hashCode | ( |  | ) |

virtual

Return hash code for this object.

Reimplemented from Lucene::Query.

## ◆ rewrite()

virtual QueryPtr Lucene::ConstantScoreQuery::rewrite | ( | const IndexReaderPtr & | reader | ) |

virtual

Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

Reimplemented from Lucene::Query.

## ◆ shared_from_this()

boost::shared_ptr< ConstantScoreQuery > Lucene::ConstantScoreQuery::shared_from_this | ( |  | ) |

inline

## ◆ toString() [1/2]

virtual String Lucene::Query::toString | ( |  | ) |

virtual

Prints a query to a string.

Reimplemented from Lucene::Query.

## ◆ toString() [2/2]

virtual String Lucene::ConstantScoreQuery::toString | ( | const String & | field | ) |

virtual

Prints a user-readable version of this query.

Reimplemented from Lucene::Query.

## Field Documentation

## ◆ filter

FilterPtr Lucene::ConstantScoreQuery::filter

protected

Referenced by ConstantScoreQuery().

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

- ConstantScoreQuery.h

clucene.sourceforge.net