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_BooleanClause_ 00008 #define _lucene_search_BooleanClause_ 00009 00010 //#include "SearchHeader.h" 00011 00012 CL_CLASS_DEF(util,StringBuffer) 00013 CL_CLASS_DEF(search,Query) 00014 00015 CL_NS_DEF(search) 00016 00017 // A clause in a BooleanQuery. 00018 class CLUCENE_EXPORT BooleanClause:LUCENE_BASE { 00019 public: 00021 enum Occur { 00023 MUST=1, 00024 00031 SHOULD=2, 00032 00036 MUST_NOT=4 00037 }; 00038 private: 00041 Query* query; 00042 00043 Occur occur; 00044 00045 /* Middle layer for the Occur enum; will be removed soon enough. */ 00046 void setFields(Occur occur); 00047 public: 00048 bool deleteQuery; 00049 00050 00051 int32_t getClauseCount(); 00052 00053 00063 BooleanClause(Query* q, const bool DeleteQuery,const bool req, const bool p); 00064 00065 BooleanClause(const BooleanClause& clone); 00066 00069 BooleanClause(Query* q, const bool DeleteQuery, Occur o); 00070 00071 00072 BooleanClause* clone() const; 00073 00074 ~BooleanClause(); 00075 00076 00078 bool equals(const BooleanClause* other) const; 00079 00081 size_t hashCode() const; 00082 00083 Occur getOccur() const; 00084 void setOccur(Occur o); 00085 00086 Query* getQuery() const; 00087 void setQuery(Query* q); 00088 00089 bool isProhibited() const; 00090 bool isRequired() const; 00091 00092 TCHAR* toString() const; 00093 00094 public: // TODO: Make private and remove for CLucene 2.3.2 00098 bool required; 00099 00103 bool prohibited; 00104 }; 00105 00106 00107 CL_NS_END 00108 #endif 00109