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 00012 // Created : 2006/1/6 00013 // 00014 00015 #ifndef _BARRELTERMPOSITIONS_H 00016 #define _BARRELTERMPOSITIONS_H 00017 00018 #include "TermPositions.h" 00019 #include "BarrelTermDocs.h" 00020 00021 namespace firtex 00022 { 00023 namespace index 00024 { 00025 class CBarrelTermPositions : public CBarrelTermDocs,public CTermPositions 00026 { 00027 public: 00028 CBarrelTermPositions(void); 00029 CBarrelTermPositions(CTermReader* pReader,CIndexInput* pDfiStream,CIndexInput* pPtiStream,CTermInfo& ti,CBitVector* deletedDocs); 00030 00031 virtual ~CBarrelTermPositions(void); 00032 public: 00036 bool seek(CTerm* term); 00037 00041 docid_t doc(); 00042 00046 count_t freq(); 00047 00052 bool next(); 00053 00061 count_t next(docid_t*& docs, count_t*& freqs); 00062 00070 bool skipTo(docid_t target,docid_t& nearTarget); 00071 00079 bool skipToPosition(loc_t target,loc_t& nearTarget); 00080 00081 freq_t docFreq(){return CBarrelTermDocs::docFreq();}; 00082 00086 void close(); 00087 00091 loc_t nextPosition(); 00092 00098 count_t nextPositions(loc_t*& positions); 00099 protected: 00100 bool decodePositions(); 00101 protected: 00102 int m_posCount; //位置个数,即df 00103 int m_posPointer; //在页中的当前位置 00104 int m_posPageSize; //页的实际使用大小 00105 int m_posLength; //block长度 00106 int m_posPagePosition; //页在pos中的位置 00107 int m_posDecodeCount; //已经解压的position个数 00108 00109 loc_t m_posPage[PAGE_SIZE]; 00110 loc_t m_posLastPos; //记录最后一个pos值 00111 00112 00113 CIndexInput* m_pPosStream; 00114 00115 }; 00116 } 00117 } 00118 00119 00120 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex