AyushP123

ranker_test

Jun 30th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. DEFINE_TESTCASE(ranker1, !backend) {
  2.     Xapian::Database db = get_database("apitest_rset");
  3.     Xapian::Enquire enquire(db);
  4.     enquire.set_query(Xapian::Query("and"));
  5.     string query ="20001 'and'";
  6.     string qrel = "20001 Q0 1 1\n20001 Q0 2 2\n20001 Q0 3 3";
  7.     std::ofstream myfile;
  8.     myfile.open("query.txt");
  9.     myfile << query;
  10.     myfile.close();
  11.     myfile.open("qrel.txt");
  12.     myfile << qrel;
  13.     myfile.close();
  14.     Xapian::MSet mymset = enquire.get_mset(0, 10);
  15.     Xapian::prepare_training_file(get_database_path("apitest_rset").c_str(),"query.txt","qrel.txt",10);
  16.  
  17.     return true;
  18. }
Add Comment
Please, Sign In to add comment