mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 19:38:53 -04:00
+ update the code to deal with the new Indexer classes
This commit is contained in:
parent
faa6df721e
commit
7251ea83d1
@ -1,6 +1,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <kiwix/indexer.h>
|
#include <kiwix/xapianIndexer.h>
|
||||||
|
#include <kiwix/cluceneIndexer.h>
|
||||||
|
|
||||||
void usage() {
|
void usage() {
|
||||||
cout << "Usage: kiwix-index [--verbose|-v] ZIM_PATH INDEX_PATH" << endl;
|
cout << "Usage: kiwix-index [--verbose|-v] ZIM_PATH INDEX_PATH" << endl;
|
||||||
@ -14,7 +15,7 @@ int main(int argc, char **argv) {
|
|||||||
char *xapianDirectoryPath = NULL;
|
char *xapianDirectoryPath = NULL;
|
||||||
bool verboseFlag = false;
|
bool verboseFlag = false;
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
kiwix::Indexer *indexer = NULL;
|
kiwix::XapianIndexer *indexer = NULL;
|
||||||
|
|
||||||
/* Argument parsing */
|
/* Argument parsing */
|
||||||
while (42) {
|
while (42) {
|
||||||
@ -57,7 +58,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
/* Try to prepare the indexing */
|
/* Try to prepare the indexing */
|
||||||
try {
|
try {
|
||||||
indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath);
|
indexer = new kiwix::XapianIndexer(zimFilePath, xapianDirectoryPath);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
cerr << "Unable to index '" << zimFilePath << "'." << endl;
|
cerr << "Unable to index '" << zimFilePath << "'." << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user