mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-09-09 15:18:55 -04:00
+ add the --verbose|-v option to kiwix-index
This commit is contained in:
parent
5891b91433
commit
c9a81bf79b
@ -28,7 +28,7 @@ namespace kiwix {
|
|||||||
this->writableDatabase = new Xapian::WritableDatabase(xapianDirectoryPath,
|
this->writableDatabase = new Xapian::WritableDatabase(xapianDirectoryPath,
|
||||||
Xapian::DB_CREATE_OR_OVERWRITE);
|
Xapian::DB_CREATE_OR_OVERWRITE);
|
||||||
|
|
||||||
/* Stemming *
|
/* Stemming */
|
||||||
/*
|
/*
|
||||||
stemmer = Xapian::Stem("french");
|
stemmer = Xapian::Stem("french");
|
||||||
indexer.set_stemmer(stemmer);
|
indexer.set_stemmer(stemmer);
|
||||||
@ -69,7 +69,7 @@ namespace kiwix {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Index next percent */
|
/* Index next percent */
|
||||||
bool Indexer::indexNextPercent() {
|
bool Indexer::indexNextPercent(const bool &verbose) {
|
||||||
float thresholdOffset = this->currentArticleOffset + this->stepSize;
|
float thresholdOffset = this->currentArticleOffset + this->stepSize;
|
||||||
size_t found;
|
size_t found;
|
||||||
|
|
||||||
@ -119,7 +119,9 @@ namespace kiwix {
|
|||||||
indexer.set_document(currentDocument);
|
indexer.set_document(currentDocument);
|
||||||
|
|
||||||
/* Debug output */
|
/* Debug output */
|
||||||
|
if (verbose) {
|
||||||
std::cout << "Indexing " << currentArticle.getLongUrl() << "..." << std::endl;
|
std::cout << "Indexing " << currentArticle.getLongUrl() << "..." << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
/* Index the title */
|
/* Index the title */
|
||||||
if (!this->htmlParser.title.empty()) {
|
if (!this->htmlParser.title.empty()) {
|
||||||
|
@ -23,7 +23,7 @@ namespace kiwix {
|
|||||||
Indexer(const string &zimFilePath, const string &xapianDirectoryPath);
|
Indexer(const string &zimFilePath, const string &xapianDirectoryPath);
|
||||||
~Indexer();
|
~Indexer();
|
||||||
|
|
||||||
bool indexNextPercent();
|
bool indexNextPercent(const bool &verbose = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void prepareIndexing();
|
void prepareIndexing();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user