CLucene - a full-featured, c++ search engine
API Documentation
#include <Query.h>
Public Member Functions | |
Query () | |
virtual | ~Query () |
void | setBoost (float_t b) |
Sets the boost for this query clause to b . | |
float_t | getBoost () const |
Gets the boost for this clause. | |
Weight * | weight (Searcher *searcher) |
Expert: Constructs an initializes a Weight for a top-level query. | |
virtual Query * | rewrite (lucene::index::IndexReader *reader) |
Expert: called to re-write queries into primitive queries. | |
virtual Query * | combine (Query **queries) |
Expert: called when re-writing queries under MultiSearcher. | |
Similarity * | getSimilarity (Searcher *searcher) |
Expert: Returns the Similarity implementation to be used for this query. | |
virtual Query * | clone () const =0 |
Returns a clone of this query. | |
virtual const TCHAR * | getQueryName () const =0 |
bool | instanceOf (const TCHAR *other) const |
virtual TCHAR * | toString (const TCHAR *field) const =0 |
Prints a query to a string, with field assumed to be the default field and omitted. | |
virtual bool | equals (Query *other) const =0 |
virtual size_t | hashCode () const =0 |
TCHAR * | toString () const |
Prints a query to a string. | |
virtual Weight * | _createWeight (Searcher *searcher) |
Expert: Constructs an appropriate Weight implementation for this query. | |
Static Public Member Functions | |
static Query * | mergeBooleanQueries (Query **queries) |
Expert: merges the clauses of a set of BooleanQuery's into a single BooleanQuery. | |
Protected Member Functions | |
Query (const Query &clone) |
Instantiable subclasses are:
A parser for queries is contained in:
lucene::search::Query::Query | ( | const Query & | clone | ) | [protected] |
lucene::search::Query::Query | ( | ) |
virtual lucene::search::Query::~Query | ( | ) | [virtual] |
void lucene::search::Query::setBoost | ( | float_t | 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
.
float_t lucene::search::Query::getBoost | ( | ) | const |
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.
Expert: Constructs an initializes a Weight for a top-level query.
virtual Query* lucene::search::Query::rewrite | ( | lucene::index::IndexReader * | reader | ) | [virtual] |
Expert: called to re-write queries into primitive queries.
Reimplemented in lucene::search::BooleanQuery, lucene::search::MultiTermQuery, lucene::search::PrefixQuery, lucene::search::RangeQuery, and lucene::search::WildcardQuery.
Expert: called when re-writing queries under MultiSearcher.
Only implemented by derived queries, with no _createWeight(Searcher) implementatation.
Reimplemented in lucene::search::MultiTermQuery, lucene::search::PrefixQuery, and lucene::search::RangeQuery.
Expert: merges the clauses of a set of BooleanQuery's into a single BooleanQuery.
A utility for use by combine(Query[]) implementations.
Similarity* lucene::search::Query::getSimilarity | ( | Searcher * | searcher | ) |
Expert: 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.
Reimplemented in lucene::search::BooleanQuery.
virtual Query* lucene::search::Query::clone | ( | ) | const [pure virtual] |
Returns a clone of this query.
Implemented in lucene::search::BooleanQuery, lucene::search::FuzzyQuery, lucene::search::PhraseQuery, lucene::search::PrefixQuery, lucene::search::RangeQuery, lucene::search::TermQuery, and lucene::search::WildcardQuery.
virtual const TCHAR* lucene::search::Query::getQueryName | ( | ) | const [pure virtual] |
bool lucene::search::Query::instanceOf | ( | const TCHAR * | other | ) | const |
virtual TCHAR* lucene::search::Query::toString | ( | const TCHAR * | field | ) | const [pure virtual] |
Prints a query to a string, with field
assumed to be the default field and omitted.
The representation used is one that is supposed to be readable by QueryParser. However, there are the following limitations:
Implemented in lucene::search::BooleanQuery, lucene::search::FuzzyQuery, lucene::search::MultiTermQuery, lucene::search::PhraseQuery, lucene::search::PrefixQuery, lucene::search::RangeQuery, and lucene::search::TermQuery.
virtual bool lucene::search::Query::equals | ( | Query * | other | ) | const [pure virtual] |
virtual size_t lucene::search::Query::hashCode | ( | ) | const [pure virtual] |
TCHAR* lucene::search::Query::toString | ( | ) | const |
Prints a query to a string.
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves. This is an Internal function
Reimplemented in lucene::search::BooleanQuery, lucene::search::PhraseQuery, and lucene::search::TermQuery.