CLucene - a full-featured, c++ search engine
API Documentation
#include <BooleanQuery.h>
Public Types | |
typedef lucene::util::CLVector < BooleanClause *, lucene::util::Deletor::Object < BooleanClause > > | ClausesType |
Public Member Functions | |
BooleanQuery (bool disableCoord=false) | |
Constructs an empty boolean query. | |
~BooleanQuery () | |
const TCHAR * | getQueryName () const |
void | add (Query *query, const bool required, const bool prohibited) |
Adds a clause to a boolean query. | |
void | add (Query *query, const bool deleteQuery, const bool required, const bool prohibited) |
void | add (Query *query, const bool deleteQuery, BooleanClause::Occur occur) |
void | add (Query *query, BooleanClause::Occur occur) |
void | getClauses (BooleanClause **clauses) const |
Copies the clauses of this query into the array. | |
BooleanClause ** | getClauses () const |
size_t | getClauseCount () const |
Give client code access to clauses.size() so we know how large the array returned by getClauses is. | |
void | add (BooleanClause *clause) |
Adds a clause to a boolean query. | |
Query * | rewrite (lucene::index::IndexReader *reader) |
Expert: called to re-write queries into primitive queries. | |
Query * | clone () const |
Returns a clone of this query. | |
bool | equals (Query *o) const |
Similarity * | getSimilarity (Searcher *searcher) |
Expert: Returns the Similarity implementation to be used for this query. | |
bool | isCoordDisabled () |
void | setCoordDisabled (bool disableCoord) |
TCHAR * | toString (const TCHAR *field) const |
Prints a user-readable version of this query. | |
size_t | hashCode () const |
Returns a hash code value for this object. | |
int32_t | getMinNrShouldMatch () |
Static Public Member Functions | |
static const TCHAR * | getClassName () |
static size_t | getMaxClauseCount () |
Return the maximum number of clauses permitted, 1024 by default. | |
static void | setMaxClauseCount (size_t maxClauseCount) |
Set the maximum number of clauses permitted. | |
static bool | getUseScorer14 () |
static void | setUseScorer14 (bool use14) |
Protected Member Functions | |
Weight * | _createWeight (Searcher *searcher) |
Expert: Constructs an appropriate Weight implementation for this query. | |
BooleanQuery (const BooleanQuery &clone) | |
Protected Attributes | |
int32_t | minNrShouldMatch |
typedef lucene:: util ::CLVector<BooleanClause*,lucene:: util ::Deletor::Object<BooleanClause> > lucene::search::BooleanQuery::ClausesType |
lucene::search::BooleanQuery::BooleanQuery | ( | const BooleanQuery & | clone | ) | [protected] |
lucene::search::BooleanQuery::BooleanQuery | ( | bool | disableCoord = false |
) |
Constructs an empty boolean query.
lucene::search::BooleanQuery::~BooleanQuery | ( | ) |
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 from lucene::search::Query.
const TCHAR* lucene::search::BooleanQuery::getQueryName | ( | ) | const [virtual] |
Implements lucene::search::Query.
static const TCHAR* lucene::search::BooleanQuery::getClassName | ( | ) | [static] |
static size_t lucene::search::BooleanQuery::getMaxClauseCount | ( | ) | [static] |
Return the maximum number of clauses permitted, 1024 by default.
Attempts to add more than the permitted number of clauses cause TooManyClauses to be thrown.
static void lucene::search::BooleanQuery::setMaxClauseCount | ( | size_t | maxClauseCount | ) | [static] |
Set the maximum number of clauses permitted.
void lucene::search::BooleanQuery::add | ( | Query * | query, | |
const bool | required, | |||
const bool | prohibited | |||
) | [inline] |
Adds a clause to a boolean query.
Clauses may be:
required
which means that documents which do not match this sub-query will not match the boolean query; prohibited
which means that documents which do match this sub-query will not match the boolean query; or required
and prohibited
.
void lucene::search::BooleanQuery::add | ( | Query * | query, | |
const bool | deleteQuery, | |||
const bool | required, | |||
const bool | prohibited | |||
) |
void lucene::search::BooleanQuery::add | ( | Query * | query, | |
const bool | deleteQuery, | |||
BooleanClause::Occur | occur | |||
) |
void lucene::search::BooleanQuery::add | ( | Query * | query, | |
BooleanClause::Occur | occur | |||
) | [inline] |
void lucene::search::BooleanQuery::getClauses | ( | BooleanClause ** | clauses | ) | const |
Copies the clauses of this query into the array.
The array must be at least as long as getClauseCount() If you want to use the clauses, make sure you null terminate it.
BooleanClause** lucene::search::BooleanQuery::getClauses | ( | ) | const |
size_t lucene::search::BooleanQuery::getClauseCount | ( | ) | const |
Give client code access to clauses.size() so we know how large the array returned by getClauses is.
void lucene::search::BooleanQuery::add | ( | BooleanClause * | clause | ) |
Query* lucene::search::BooleanQuery::rewrite | ( | lucene::index::IndexReader * | reader | ) | [virtual] |
Expert: called to re-write queries into primitive queries.
Reimplemented from lucene::search::Query.
Query* lucene::search::BooleanQuery::clone | ( | ) | const [virtual] |
bool lucene::search::BooleanQuery::equals | ( | Query * | o | ) | const [virtual] |
Implements lucene::search::Query.
Similarity* lucene::search::BooleanQuery::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 from lucene::search::Query.
bool lucene::search::BooleanQuery::isCoordDisabled | ( | ) |
void lucene::search::BooleanQuery::setCoordDisabled | ( | bool | disableCoord | ) |
static bool lucene::search::BooleanQuery::getUseScorer14 | ( | ) | [static] |
static void lucene::search::BooleanQuery::setUseScorer14 | ( | bool | use14 | ) | [static] |
TCHAR* lucene::search::BooleanQuery::toString | ( | const TCHAR * | field | ) | const [virtual] |
size_t lucene::search::BooleanQuery::hashCode | ( | ) | const [virtual] |
int32_t lucene::search::BooleanQuery::getMinNrShouldMatch | ( | ) |
int32_t lucene::search::BooleanQuery::minNrShouldMatch [protected] |