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_Query_h 00008 #define _lucene_search_Query_h 00009 00010 00011 //#include "CLucene/index/IndexReader.h" 00012 CL_CLASS_DEF(index,IndexReader) 00013 //#include "Filter.h" 00014 //#include "Sort.h" 00015 //#include "CLucene/util/VoidList.h" 00016 //#include "Explanation.h" 00017 //#include "Similarity.h" 00018 00019 CL_NS_DEF(search) 00020 class Weight; 00021 class Similarity; 00022 class Searcher; 00023 00043 class CLUCENE_EXPORT Query :LUCENE_BASE { 00044 private: 00045 // query boost factor 00046 float_t boost; 00047 protected: 00048 Query(const Query& clone); 00049 public: 00050 Query(); 00051 virtual ~Query(); 00052 00057 void setBoost(float_t b); 00058 00063 float_t getBoost() const; 00064 00066 Weight* weight(Searcher* searcher); 00067 00069 virtual Query* rewrite(CL_NS(index)::IndexReader* reader); 00070 00076 virtual Query* combine(Query** queries); 00077 00083 static Query* mergeBooleanQueries(Query** queries); 00084 00089 Similarity* getSimilarity(Searcher* searcher); 00090 00092 virtual Query* clone() const = 0; 00093 virtual const TCHAR* getQueryName() const = 0; 00094 bool instanceOf(const TCHAR* other) const; 00095 00110 virtual TCHAR* toString(const TCHAR* field) const = 0; 00111 00112 virtual bool equals(Query* other) const = 0; 00113 virtual size_t hashCode() const = 0; 00114 00116 TCHAR* toString() const; 00117 00118 00124 virtual Weight* _createWeight(Searcher* searcher); 00125 00126 }; 00127 00128 CL_NS_END 00129 #endif