|
|
@ -11,14 +11,21 @@ int main(int argc, char **argv) {
|
|
|
|
/* Init the variables */
|
|
|
|
/* Init the variables */
|
|
|
|
char *zimFilePath = argv[1];
|
|
|
|
char *zimFilePath = argv[1];
|
|
|
|
char *xapianDirectoryPath = argv[2];
|
|
|
|
char *xapianDirectoryPath = argv[2];
|
|
|
|
kiwix::Indexer *indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath);
|
|
|
|
kiwix::Indexer *indexer = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Try to prepare the indexing */
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath);
|
|
|
|
|
|
|
|
} catch (...) {
|
|
|
|
|
|
|
|
cout << "Unable to index '" << zimFilePath << "'." << endl;
|
|
|
|
|
|
|
|
exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Start the indexing */
|
|
|
|
/* Start the indexing */
|
|
|
|
if (indexer != NULL) {
|
|
|
|
if (indexer != NULL) {
|
|
|
|
indexer->startIndexing();
|
|
|
|
|
|
|
|
while (indexer->indexNextPercent()) {};
|
|
|
|
while (indexer->indexNextPercent()) {};
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
cout << "Unable to start the indexation process" << endl;
|
|
|
|
cout << "Unable instanciate the Kiwix indexer." << endl;
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|