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_WildcardQuery_ 00008 #define _lucene_search_WildcardQuery_ 00009 00010 //#include "CLucene/index/IndexReader.h" 00011 CL_CLASS_DEF(index,Term) 00012 #include "MultiTermQuery.h" 00013 #include "Filter.h" 00014 //#include "WildcardTermEnum.h" 00015 00016 CL_NS_DEF(search) 00017 00018 00027 class CLUCENE_EXPORT WildcardQuery: public MultiTermQuery { 00028 protected: 00029 FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader); 00030 WildcardQuery(const WildcardQuery& clone); 00031 public: 00032 WildcardQuery(CL_NS(index)::Term* term); 00033 ~WildcardQuery(); 00034 00035 //Returns the string "WildcardQuery" 00036 const TCHAR* getQueryName() const; 00037 static const TCHAR* getClassName(); 00038 00039 size_t hashCode() const; 00040 bool equals(Query* other) const; 00041 Query* clone() const; 00042 00043 Query* rewrite(CL_NS(index)::IndexReader* reader); 00044 private: 00045 bool termContainsWildcard; 00046 }; 00047 00048 00049 00050 class WildcardFilter: public Filter 00051 { 00052 private: 00053 CL_NS(index)::Term* term; 00054 protected: 00055 WildcardFilter( const WildcardFilter& copy ); 00056 00057 public: 00058 WildcardFilter(CL_NS(index)::Term* term); 00059 ~WildcardFilter(); 00060 00063 CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); 00064 00065 Filter* clone() const; 00066 TCHAR* toString(); 00067 }; 00068 00069 00070 CL_NS_END 00071 #endif