CLucene - a full-featured, c++ search engine
API Documentation
The abstract base class for queries. More...
#include <SearchHeader.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 as the default field for terms. | |
| 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) | |
The abstract base class for queries.
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] |
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.
| 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.
Expert: called when re-writing queries under MultiSearcher.
Only implemented by derived queries, with no _createWeight(Searcher) implementatation.
| virtual bool lucene::search::Query::equals | ( | Query * | other | ) | const [pure virtual] |
Referenced by lucene::search::BooleanClause::equals().
| 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.
| virtual const TCHAR* lucene::search::Query::getQueryName | ( | ) | const [pure virtual] |
| 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.
| virtual size_t lucene::search::Query::hashCode | ( | ) | const [pure virtual] |
| bool lucene::search::Query::instanceOf | ( | const TCHAR * | other | ) | const |
Expert: merges the clauses of a set of BooleanQuery's into a single BooleanQuery.
A utility for use by combine(Query[]) implementations.
| 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, and lucene::search::RangeQuery.
| 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.
| TCHAR* lucene::search::Query::toString | ( | ) | const |
Prints a query to a string.
| virtual TCHAR* lucene::search::Query::toString | ( | const TCHAR * | field | ) | const [pure virtual] |
Prints a query to a string, with field as the default field for terms.
The representation used is one that is readable by QueryParser (although, if the query was created by the parser, the printed representation may not be exactly what was parsed).
Implemented in lucene::search::BooleanQuery, lucene::search::FuzzyQuery, lucene::search::MultiTermQuery, lucene::search::PhraseQuery, lucene::search::PrefixQuery, lucene::search::RangeQuery, and lucene::search::TermQuery.
Expert: Constructs an initializes a Weight for a top-level query.