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_multisearcher 00008 #define _lucene_search_multisearcher 00009 00010 00011 //#include "SearchHeader.h" 00012 #include "Searchable.h" 00013 CL_CLASS_DEF(document,Document) 00014 CL_CLASS_DEF(index,Term) 00015 00016 CL_NS_DEF(search) 00017 00023 class CLUCENE_EXPORT MultiSearcher: public Searcher { 00024 private: 00025 Searchable** searchables; 00026 int32_t searchablesLen; 00027 int32_t* starts; 00028 int32_t _maxDoc; 00029 protected: 00030 int32_t* getStarts() { 00031 return starts; 00032 } 00033 int32_t getLength() { 00034 return searchablesLen; 00035 } 00036 00037 public: 00039 MultiSearcher(Searchable** searchables); 00040 00041 ~MultiSearcher(); 00042 00044 void close() ; 00045 00046 int32_t docFreq(const CL_NS(index)::Term* term) const ; 00047 00049 bool doc(int32_t n, CL_NS(document)::Document* document); 00050 00053 int32_t searcherIndex(int32_t n) const; 00054 00055 int32_t subSearcher(int32_t n) const; 00056 00057 int32_t subDoc(int32_t n) const; 00058 00059 int32_t maxDoc() const; 00060 00061 TopDocs* _search(Query* query, Filter* filter, const int32_t nDocs) ; 00062 00063 TopFieldDocs* _search (Query* query, Filter* filter, const int32_t n, const Sort* sort); 00064 00079 void _search(Query* query, Filter* filter, HitCollector* results); 00080 00081 Query* rewrite(Query* original); 00082 void explain(Query* query, int32_t doc, Explanation* ret); 00083 }; 00084 00085 CL_NS_END 00086 #endif