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 : 2005/12/9 00013 // 00014 #ifndef __STOREDFIELDSWRITER_H 00015 #define __STOREDFIELDSWRITER_H 00016 00017 #include "../utility/StdHeader.h" 00018 #include "../document/Document.h" 00019 #include "../document/Field.h" 00020 #include "../store/Directory.h" 00021 #include "../store/IndexOutput.h" 00022 #include <string> 00023 00024 #define STOREDFIELD_WRITEBUFFSIZE 4096 //4K 00025 00026 using namespace std; 00027 using namespace firtex::store; 00028 using namespace firtex; 00029 00030 00031 namespace firtex 00032 { 00033 namespace index 00034 { 00035 class CFieldsInfo; 00036 class CStoredFieldsWriter 00037 { 00038 public: 00039 CStoredFieldsWriter(CDirectory* pDirectory,const tstring& barrel,CFieldsInfo* fieldsInfo); 00040 CStoredFieldsWriter(); 00041 ~CStoredFieldsWriter(void); 00042 public: 00047 void addDocument(document::CDocument* pDoc); 00048 00049 void open(CDirectory* pDirectory,const tstring& barrel,CFieldsInfo* fieldsInfo); 00050 void close(); 00051 protected: 00052 CIndexOutput* m_pFieldValueWriter; 00053 CIndexOutput* m_pFieldIndexWriter; 00054 00055 CFieldsInfo* m_pFieldsInfo; 00056 }; 00057 00058 } 00059 } 00060 00061 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex