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 : 2005/12/27 00013 // 00014 #ifndef _INDEXSEARCHER_H 00015 #define _INDEXSEARCHER_H 00016 00017 #include "Searcher.h" 00018 #include "../index/IndexReader.h" 00019 #include "Filter.h" 00020 #include "Sort.h" 00021 using namespace firtex::index; 00022 00023 namespace firtex 00024 { 00025 namespace search 00026 { 00027 class CIndexSearcher : public CSearcher 00028 { 00029 public: 00030 CIndexSearcher(void); 00031 CIndexSearcher(const tchar* indexName); 00032 CIndexSearcher(CIndexReader* pIndexReader); 00033 virtual ~CIndexSearcher(void); 00034 public: 00041 CQueryHits* search(CQuery* pQuery,int nDocs); 00042 00050 CQueryHits* search(CQuery* pQuery,CFilter* pFilter,int nDocs); 00051 00060 CQueryHits* search(CQuery* pQuery,CFilter* pFilter,int nDocs,CSort* pSort); 00061 00068 CQuery* optimizeQuery(CQuery* pOrgQuery); 00069 00070 00076 freq_t docFreq(CTerm* t); 00077 00082 CTermReader* termReader()const; 00083 00089 CNormBytes* norms(const tchar* field); 00090 00095 count_t maxDocs(){return m_pIndexReader->maxDoc();} 00096 00101 void attachReader(CIndexReader* pIndexReader); 00102 00107 CIndexReader* detachReader(); 00108 00114 document::CDocument* doc(docid_t docID){return m_pIndexReader->document(docID);}; 00115 private: 00116 CIndexReader* m_pIndexReader; 00117 CTermReader* m_pTermReader; 00118 }; 00119 } 00120 } 00121 00122 00123 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex