FirteX-高性能全文索引和检索平台API Documentation |
00001 // 00002 // Copyright(C) 2005--2006 Institute of Computing Tech, Chinese Academy of Sciences. 00003 // All rights reserved. 00004 // This file is part of FirteX (www.firtex.org) 00005 // 00006 // Use of the FirteX is subject to the terms of the software license set forth in 00007 // the LICENSE file included with this software, and also available at 00008 // http://www.firtex.org/license.html 00009 // 00010 // Author : 郭瑞杰(GuoRuijie) 00011 // Email : ruijieguo@software.ict.ac.cn,ruijieguo@gmail.com 00012 // Created : 2006/5/9 00013 // 00014 #ifndef _REQPROHSCORER_H 00015 #define _REQPROHSCORER_H 00016 00017 #include "Scorer.h" 00018 00019 namespace firtex 00020 { 00021 namespace search 00022 { 00023 class CReqProhScorer : public CScorer 00024 { 00025 #define REQPROHSCORER_PAGESIZE 1024 00026 public: 00027 CReqProhScorer(CScorer* pReqScorer,CScorer* pProhScorer); 00028 virtual ~CReqProhScorer(void); 00029 public: 00034 count_t nextDocs(); 00035 00042 count_t scores(docid_t*& docs,score_t*& scores); 00043 00051 bool skipTo(docid_t target,docid_t& nearTarget); 00052 00057 bool next(); 00058 /* 00059 * 返回当前位置文档的打分结果,必须配合{@link skipTo(docid_t,DOC_ID)}或{@link next()}使用,只有返回true后才有效 00060 */ 00061 score_t score(); 00062 00063 /* 00064 * 返回当前位置文档ID,必须配合{@link skipTo(docid_t,DOC_ID)}或{@link next()}使用,只有返回true后才有效 00065 */ 00066 docid_t doc(); 00067 protected: 00068 CScorer* m_pReqScorer; 00069 CScorer* m_pProhScorer; 00070 00071 docid_t m_docs[REQPROHSCORER_PAGESIZE]; //文档ID,内存由CTermDocs维护 00072 score_t m_scores[REQPROHSCORER_PAGESIZE]; //打分结果 00073 count_t m_numDocs; //文档数 00074 00075 }; 00076 } 00077 } 00078 00079 00080 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex