mirror of https://github.com/kiwix/libkiwix.git
+ remove debug outputs
This commit is contained in:
parent
83bcb034b8
commit
fe1095082c
|
@ -23,7 +23,7 @@ namespace kiwix {
|
|||
}
|
||||
|
||||
/* 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 */
|
||||
this->results.clear();
|
||||
this->resultOffset = this->results.begin();
|
||||
|
@ -44,8 +44,10 @@ namespace kiwix {
|
|||
/* Set the query in the enquire object */
|
||||
enquire.set_query(query);
|
||||
|
||||
if (verbose == true) {
|
||||
cout << "Performing query `" <<
|
||||
query.get_description() << "'" << endl;
|
||||
}
|
||||
|
||||
/* Get the results */
|
||||
Xapian::MSet matches = enquire.get_mset(0, resultsCount);
|
||||
|
@ -61,10 +63,12 @@ namespace kiwix {
|
|||
|
||||
this->results.push_back(result);
|
||||
|
||||
if (verbose == true) {
|
||||
cout << "Document ID " << *i << " \t";
|
||||
cout << i.get_percent() << "% ";
|
||||
cout << "\t[" << doc.get_data() << "] - " << doc.get_value(0) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the cursor to the begining */
|
||||
this->resultOffset = this->results.begin();
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace kiwix {
|
|||
std::vector<Result> results;
|
||||
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);
|
||||
void closeDatabase();
|
||||
void reset();
|
||||
|
|
Loading…
Reference in New Issue