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_ConjunctionScorer_ 00008 #define _lucene_search_ConjunctionScorer_ 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 #include "Scorer.h" 00014 #include "Similarity.h" 00015 00016 CL_NS_DEF(search) 00017 00018 00019 class ConjunctionScorer: public Scorer { 00020 private: 00021 CL_NS(util)::CLLinkedList<Scorer*,CL_NS(util)::Deletor::Object<Scorer> > scorers; 00022 bool firstTime; 00023 bool more; 00024 float_t coord; 00025 00026 Scorer* first() const; 00027 Scorer* last(); 00028 void sortScorers(); 00029 bool doNext(); 00030 void init(); 00031 public: 00032 ConjunctionScorer(Similarity* similarity); 00033 virtual ~ConjunctionScorer(); 00034 TCHAR* toString(void){ 00035 return STRDUP_TtoT(_T("ConjunctionScorer")); 00036 } 00037 void add(Scorer* scorer); 00038 int32_t doc() const; 00039 bool next(); 00040 bool skipTo(int32_t target); 00041 float_t score(); 00042 virtual void explain(int32_t doc, Explanation* ret) { 00043 _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: ConjunctionScorer::explain"); 00044 } 00045 00046 00047 }; 00048 00049 CL_NS_END 00050 #endif