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


lucene::search::BooleanQuery Class Reference

#include <BooleanQuery.h>

Inheritance diagram for lucene::search::BooleanQuery:
lucene::search::Query lucene::debug::LuceneBase

List of all members.

Classes

class  BooleanWeight

Public Types

typedef lucene::util::CLVector
< BooleanClause
*, lucene::util::Deletor::Object
< BooleanClause > > 
ClausesType

Public Member Functions

 BooleanQuery ()
 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 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.
Queryrewrite (lucene::index::IndexReader *reader)
 Expert: called to re-write queries into primitive queries.
Queryclone () const
 Returns a clone of this query.
bool equals (Query *o) const
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.

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.

Protected Member Functions

Weight_createWeight (Searcher *searcher)
 Expert: Constructs an appropriate Weight implementation for this query.
 BooleanQuery (const BooleanQuery &clone)

Member Typedef Documentation

typedef lucene:: util ::CLVector<BooleanClause*,lucene:: util ::Deletor::Object<BooleanClause> > lucene::search::BooleanQuery::ClausesType

Constructor & Destructor Documentation

lucene::search::BooleanQuery::BooleanQuery ( const BooleanQuery clone  )  [protected]
lucene::search::BooleanQuery::BooleanQuery (  ) 

Constructs an empty boolean query.

lucene::search::BooleanQuery::~BooleanQuery (  ) 

Member Function Documentation

Weight* lucene::search::BooleanQuery::_createWeight ( Searcher searcher  )  [inline, protected, 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 from lucene::search::Query.

References _CLNEW.

void lucene::search::BooleanQuery::add ( BooleanClause clause  ) 

Adds a clause to a boolean query.

See also:
getMaxClauseCount()
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  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
  • neither, in which case matched documents are neither prohibited from nor required to match the sub-query. However, a document must match at least 1 sub-query to match the boolean query.

It is an error to specify a clause as both required and prohibited.

See also:
getMaxClauseCount()
Query* lucene::search::BooleanQuery::clone (  )  const [virtual]

Returns a clone of this query.

Implements lucene::search::Query.

bool lucene::search::BooleanQuery::equals ( Query o  )  const
static const TCHAR* lucene::search::BooleanQuery::getClassName (  )  [static]
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.

BooleanClause** lucene::search::BooleanQuery::getClauses (  )  const
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.

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.

const TCHAR* lucene::search::BooleanQuery::getQueryName (  )  const [virtual]

Implements lucene::search::Query.

size_t lucene::search::BooleanQuery::hashCode (  )  const [virtual]

Returns a hash code value for this object.

Implements lucene::search::Query.

Query* lucene::search::BooleanQuery::rewrite ( lucene::index::IndexReader reader  )  [virtual]

Expert: called to re-write queries into primitive queries.

Reimplemented from lucene::search::Query.

static void lucene::search::BooleanQuery::setMaxClauseCount ( size_t  maxClauseCount  )  [static]

Set the maximum number of clauses permitted.

TCHAR* lucene::search::BooleanQuery::toString ( const TCHAR *  field  )  const [virtual]

Prints a user-readable version of this query.

Implements lucene::search::Query.


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

clucene.sourceforge.net