00001 /*========================================================================== 00002 * Copyright (c) 2001 Carnegie Mellon University. All Rights Reserved. 00003 * 00004 * Use of the Lemur Toolkit for Language Modeling and Information Retrieval 00005 * is subject to the terms of the software license set forth in the LICENSE 00006 * file included with this software, and also available at 00007 * http://www.lemurproject.org/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 00020 #include "common_headers.hpp" 00021 #include "RetrievalMethod.hpp" 00022 #include "RetMethodManager.hpp" 00023 #include "IndexManager.hpp" 00024 #include "DocScore.hpp" 00025 00026 class DistSearchMethod { 00027 public: 00028 DistSearchMethod() {csindex = NULL; defrt = RetMethodManager::INQUERY; returnCount=1000;} 00029 DistSearchMethod(const Index* index, RetMethodManager::RetModel defmodel=RetMethodManager::INQUERY) { 00030 csindex = index; 00031 defrt = defmodel; 00032 } 00033 ~DistSearchMethod() {} 00034 00036 void setReturnCount(int retCount){returnCount=retCount;}; 00037 00039 void setIndex(const Index* index){csindex = index;} ; 00040 00042 void setDefaultRetMethod(RetMethodManager::RetModel rt) {defrt = rt;}; 00043 00045 00051 void scoreIndexSet(const Query &qry, const IndexedRealVector &indexset, 00052 DocScoreVector** results); 00053 00055 void scoreIndexSet(const Query &qry, const vector<string> &indexset, 00056 DocScoreVector** results); 00057 00059 static void indexToID(const Index* ind, const IndexedRealVector* ivec, 00060 DocScoreVector* dvec); 00061 00062 protected: 00064 void doSingleRetr(); 00065 00066 const Index* csindex; // the collection selection index 00067 RetMethodManager::RetModel defrt; // default retrieval method to use if no param is avail 00068 const Query* query; // the query we're currently working on 00069 DocScoreVector** allres; // where to store all results 00070 int reslen; // length of allres 00071 int returnCount;//the number of result should be returned 00072 };