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 _QUERY_H 00015 #define _QUERY_H 00016 00017 #include "Scorer.h" 00018 #include "Searcher.h" 00019 00020 namespace firtex 00021 { 00022 namespace search 00023 { 00024 class CSimilarity; 00025 class CWeight; 00026 class CQuery 00027 { 00028 public: 00029 CQuery(void); 00030 virtual ~CQuery(void); 00031 public: 00035 float getBoost(){return m_fBoost;} 00036 void setBoost(float fBoost){m_fBoost = fBoost;} 00037 00043 CWeight* weight(CSearcher* pSearcher); 00044 00049 bool instanceOf(const tchar* other); 00050 00056 CSimilarity* getSimilarity(CSearcher* pSearcher); 00057 00064 virtual CQuery* optimize(firtex::index::CIndexReader* pReader); 00065 public: 00070 virtual CWeight* createWeight(CSearcher* pSearcher); 00071 00077 virtual CScorer* scorer(CSearcher* pSearcher); 00078 00083 virtual CQuery* clone()=0; 00084 00088 virtual const tchar* getQueryName() const = 0; 00089 protected: 00090 float m_fBoost; 00091 }; 00092 } 00093 } 00094 00095 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex