From c9a81bf79b6a8d82a8d0a9e08ad55f44732f5774 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Thu, 15 Jul 2010 19:11:43 +0000 Subject: [PATCH] + add the --verbose|-v option to kiwix-index --- src/common/kiwix/indexer.cpp | 8 +++++--- src/common/kiwix/indexer.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/kiwix/indexer.cpp b/src/common/kiwix/indexer.cpp index dde989f47..05850abe3 100644 --- a/src/common/kiwix/indexer.cpp +++ b/src/common/kiwix/indexer.cpp @@ -28,7 +28,7 @@ namespace kiwix { this->writableDatabase = new Xapian::WritableDatabase(xapianDirectoryPath, Xapian::DB_CREATE_OR_OVERWRITE); - /* Stemming * + /* Stemming */ /* stemmer = Xapian::Stem("french"); indexer.set_stemmer(stemmer); @@ -69,7 +69,7 @@ namespace kiwix { } /* Index next percent */ - bool Indexer::indexNextPercent() { + bool Indexer::indexNextPercent(const bool &verbose) { float thresholdOffset = this->currentArticleOffset + this->stepSize; size_t found; @@ -119,7 +119,9 @@ namespace kiwix { indexer.set_document(currentDocument); /* Debug output */ - std::cout << "Indexing " << currentArticle.getLongUrl() << "..." << std::endl; + if (verbose) { + std::cout << "Indexing " << currentArticle.getLongUrl() << "..." << std::endl; + } /* Index the title */ if (!this->htmlParser.title.empty()) { diff --git a/src/common/kiwix/indexer.h b/src/common/kiwix/indexer.h index b58dda0a7..a73073ec4 100644 --- a/src/common/kiwix/indexer.h +++ b/src/common/kiwix/indexer.h @@ -23,7 +23,7 @@ namespace kiwix { Indexer(const string &zimFilePath, const string &xapianDirectoryPath); ~Indexer(); - bool indexNextPercent(); + bool indexNextPercent(const bool &verbose = false); protected: void prepareIndexing();