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/2/23 00013 // 00014 #ifndef _TERMFIELDSEARCHER_H 00015 #define _TERMFIELDSEARCHER_H 00016 00017 #include "../utility/StdHeader.h" 00018 #include "../utility/BitVector.h" 00019 #include "../store/IndexInput.h" 00020 #include "../store/Directory.h" 00021 #include "TermInfo.h" 00022 #include "TermReader.h" 00023 #include "Vocabulary.h" 00024 00025 using namespace firtex::store; 00026 00027 namespace firtex 00028 { 00029 namespace index 00030 { 00031 class CWordFieldIndexer; 00032 class CWordFieldTermReader : public CTermReader 00033 { 00034 public: 00035 CWordFieldTermReader(void); 00036 CWordFieldTermReader(CDirectory* pDirectory,const tchar* barrelname,CFieldInfo* pFieldInfo,CBitVector* deletedDocs); 00037 virtual ~CWordFieldTermReader(void); 00038 public: 00046 void open(CDirectory* pDirectory,const tchar* barrelname,CFieldInfo* pFieldInfo,CBitVector* deletedDocs); 00047 00055 CTermIterator* termIterator(CTerm* pLowerTerm,CTerm* pUpperTerm); 00056 00063 CTermIterator* termIterator(const tchar* field); 00064 00069 bool seek(CTerm* term); 00070 00075 CTermDocs* termDocs(); 00076 00081 CTermPositions* termPositions(); 00082 00086 freq_t docFreq(CTerm* term); 00087 00091 void close(); 00092 00093 protected: 00098 CTermInfo* termInfo(CTerm* term); 00099 protected: 00100 CFXString m_field; 00101 CIndexInput* m_dfiStream; 00102 CIndexInput* m_ptiStream; 00103 CBitVector* m_deletedDocs; 00104 00105 CVocabulary<termid_t>* m_pVocabulary; 00106 CTermInfo* m_pCurTermInfo; 00107 }; 00108 } 00109 } 00110 00111 #endif 00112
http://www.firtex.org http://www.sourceforge.net/projects/firtex