CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_search_TermQuery_ 00008 #define _lucene_search_TermQuery_ 00009 00010 00011 //#include "SearchHeader.h" 00012 //#include "Scorer.h" 00013 CL_CLASS_DEF(index,Term) 00014 //#include "TermScorer.h" 00015 #include "Query.h" 00016 //#include "CLucene/index/IndexReader.h" 00017 CL_CLASS_DEF(util,StringBuffer) 00018 //#include "CLucene/index/Terms.h" 00019 00020 CL_NS_DEF(search) 00021 00022 00026 class CLUCENE_EXPORT TermQuery: public Query { 00027 private: 00028 CL_NS(index)::Term* term; 00029 protected: 00030 Weight* _createWeight(Searcher* searcher); 00031 TermQuery(const TermQuery& clone); 00032 public: 00033 // Constructs a query for the term <code>t</code>. 00034 TermQuery(CL_NS(index)::Term* t); 00035 ~TermQuery(); 00036 00037 static const TCHAR* getClassName(); 00038 const TCHAR* getQueryName() const; 00039 00040 //added by search highlighter 00041 CL_NS(index)::Term* getTerm(bool pointer=true) const; 00042 00043 // Prints a user-readable version of this query. 00044 TCHAR* toString(const TCHAR* field) const; 00045 00046 bool equals(Query* other) const; 00047 Query* clone() const; 00048 00050 size_t hashCode() const; 00051 }; 00052 CL_NS_END 00053 #endif 00054