mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 20:10:25 -04:00
+ stub of kiwix-indexer
This commit is contained in:
parent
2adde00b01
commit
8e6f0047d6
26
src/indexer/kiwix-index.cpp
Normal file
26
src/indexer/kiwix-index.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include <kiwix/indexer.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
/* Check if we have enough arguments */
|
||||||
|
if (argc < 3) {
|
||||||
|
cout << "Usage: kiwix-index ZIM_PATH INDEX_PATH" << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Init the variables */
|
||||||
|
char *zimFilePath = argv[1];
|
||||||
|
char *xapianDirectoryPath = argv[2];
|
||||||
|
kiwix::Indexer *indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath);
|
||||||
|
|
||||||
|
/* Start the indexing */
|
||||||
|
if (indexer != NULL) {
|
||||||
|
indexer->startIndexing();
|
||||||
|
while (indexer->indexNextPercent()) {};
|
||||||
|
} else {
|
||||||
|
cout << "Unable to start the indexation process" << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user