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.cs.cmu.edu/~lemur/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::CORI_DOC; returnCount=1000;} 00029 DistSearchMethod(Index* index, RetMethodManager::RetModel defmodel=RetMethodManager::CORI_DOC) {csindex = index; defrt = defmodel;} 00030 ~DistSearchMethod() {} 00031 00033 void setReturnCount(int retCount){returnCount=retCount;}; 00034 00036 void setIndex(Index* index){csindex = index;} ; 00037 00039 void setDefaultRetMethod(RetMethodManager::RetModel rt) {defrt = rt;}; 00040 00042 00048 void scoreIndexSet(Query &qry, IndexedRealVector &indexset, DocScoreVector** results); 00049 00051 void scoreIndexSet(Query &qry, vector<string> &indexset, DocScoreVector** results); 00052 00054 static void indexToID(Index* ind, IndexedRealVector* ivec, DocScoreVector* dvec); 00055 00056 protected: 00058 void doSingleRetr(); 00059 00060 Index* csindex; // the collection selection index 00061 RetMethodManager::RetModel defrt; // default retrieval method to use if no param is avail 00062 Query* query; // the query we're currently working on 00063 DocScoreVector** allres; // where to store all results 00064 int reslen; // length of allres 00065 int returnCount;//the number of result should be returned 00066 };