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


lucene::search::PrefixQuery Class Reference

A Query that matches documents containing terms with a specified prefix. More...

#include <PrefixQuery.h>

Inheritance diagram for lucene::search::PrefixQuery:

lucene::search::Query

Public Member Functions

 PrefixQuery (lucene::index::Term *Prefix)
 ~PrefixQuery ()
const TCHAR * getQueryName () const
lucene::index::TermgetPrefix (bool pointer=true)
 Returns the prefix of this query.
Querycombine (Query **queries)
 Expert: called when re-writing queries under MultiSearcher.
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 *other) const
TCHAR * toString (const TCHAR *field) const
 Prints a query to a string, with field assumed to be the default field and omitted.
size_t hashCode () const

Static Public Member Functions

static const TCHAR * getClassName ()

Protected Member Functions

 PrefixQuery (const PrefixQuery &clone)

Detailed Description

A Query that matches documents containing terms with a specified prefix.

A PrefixQuery is built by QueryParser for input like app*.


Constructor & Destructor Documentation

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

lucene::search::PrefixQuery::PrefixQuery ( lucene::index::Term Prefix  ) 

lucene::search::PrefixQuery::~PrefixQuery (  ) 


Member Function Documentation

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

Implements lucene::search::Query.

static const TCHAR* lucene::search::PrefixQuery::getClassName (  )  [static]

lucene:: index ::Term* lucene::search::PrefixQuery::getPrefix ( bool  pointer = true  ) 

Returns the prefix of this query.

Query* lucene::search::PrefixQuery::combine ( Query **  queries  )  [virtual]

Expert: called when re-writing queries under MultiSearcher.

Only implemented by derived queries, with no _createWeight(Searcher) implementatation.

Reimplemented from lucene::search::Query.

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

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

Reimplemented from lucene::search::Query.

Query* lucene::search::PrefixQuery::clone (  )  const [virtual]

Returns a clone of this query.

Implements lucene::search::Query.

bool lucene::search::PrefixQuery::equals ( Query other  )  const [virtual]

Implements lucene::search::Query.

TCHAR* lucene::search::PrefixQuery::toString ( const TCHAR *  field  )  const [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:

  • If the query was created by the parser, the printed representation may not be exactly what was parsed. For example, characters that need to be escaped will be represented without the required backslash.
  • Some of the more complicated queries (e.g. span queries) don't have a representation that can be parsed by QueryParser.

Implements lucene::search::Query.

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

Implements lucene::search::Query.


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

clucene.sourceforge.net