+ remove debug outputs

This commit is contained in:
kelson42 2010-03-25 08:49:20 +00:00
parent 83bcb034b8
commit fe1095082c
2 changed files with 12 additions and 8 deletions

View File

@ -23,7 +23,7 @@ namespace kiwix {
} }
/* Search strings in the database */ /* Search strings in the database */
void Searcher::search(string search, const unsigned int resultsCount) { void Searcher::search(string search, const unsigned int resultsCount, bool verbose) {
/* Reset the results */ /* Reset the results */
this->results.clear(); this->results.clear();
this->resultOffset = this->results.begin(); this->resultOffset = this->results.begin();
@ -44,8 +44,10 @@ namespace kiwix {
/* Set the query in the enquire object */ /* Set the query in the enquire object */
enquire.set_query(query); enquire.set_query(query);
cout << "Performing query `" << if (verbose == true) {
query.get_description() << "'" << endl; cout << "Performing query `" <<
query.get_description() << "'" << endl;
}
/* Get the results */ /* Get the results */
Xapian::MSet matches = enquire.get_mset(0, resultsCount); Xapian::MSet matches = enquire.get_mset(0, resultsCount);
@ -61,9 +63,11 @@ namespace kiwix {
this->results.push_back(result); this->results.push_back(result);
cout << "Document ID " << *i << " \t"; if (verbose == true) {
cout << i.get_percent() << "% "; cout << "Document ID " << *i << " \t";
cout << "\t[" << doc.get_data() << "] - " << doc.get_value(0) << endl; cout << i.get_percent() << "% ";
cout << "\t[" << doc.get_data() << "] - " << doc.get_value(0) << endl;
}
} }
/* Set the cursor to the begining */ /* Set the cursor to the begining */

View File

@ -35,7 +35,7 @@ namespace kiwix {
std::vector<Result> results; std::vector<Result> results;
std::vector<Result>::iterator resultOffset; std::vector<Result>::iterator resultOffset;
void search(string search, const unsigned int resultsCount); void search(string search, const unsigned int resultsCount, bool verbose=false);
bool getNextResult(string &url, string &title, unsigned int &score); bool getNextResult(string &url, string &title, unsigned int &score);
void closeDatabase(); void closeDatabase();
void reset(); void reset();