mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-24 04:20:56 -04:00
Updating CLucene search and index routines
This commit is contained in:
parent
2ff5f680c8
commit
4d5dcea857
@ -104,6 +104,7 @@ int main(int argc, char **argv) {
|
|||||||
/* Start the indexing */
|
/* Start the indexing */
|
||||||
if (indexer != NULL) {
|
if (indexer != NULL) {
|
||||||
while (indexer->indexNextPercent(verboseFlag)) {};
|
while (indexer->indexNextPercent(verboseFlag)) {};
|
||||||
|
delete indexer;
|
||||||
} else {
|
} else {
|
||||||
cerr << "Unable instanciate the Kiwix indexer." << endl;
|
cerr << "Unable instanciate the Kiwix indexer." << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -32,12 +32,14 @@ void usage() {
|
|||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
/* Init the variables */
|
/* Init the variables */
|
||||||
char *indexPath = NULL;
|
//const char *indexPath = "/home/itamar/.www.kiwix.org/kiwix/43k0i1j4.default/6d2e587b-d586-dc6a-dc6a-e4ef035a1495d15c.index";
|
||||||
char *search = NULL;
|
//const char *indexPath = "/home/itamar/testindex";
|
||||||
|
const char *indexPath = NULL;
|
||||||
|
const char *search = NULL;
|
||||||
bool verboseFlag = false;
|
bool verboseFlag = false;
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
supportedBackend backend = XAPIAN;
|
supportedBackend backend = CLUCENE;
|
||||||
|
|
||||||
kiwix::Searcher *searcher = NULL;
|
kiwix::Searcher *searcher = NULL;
|
||||||
|
|
||||||
@ -110,6 +112,8 @@ int main(int argc, char **argv) {
|
|||||||
while (searcher->getNextResult(url, title, score)) {
|
while (searcher->getNextResult(url, title, score)) {
|
||||||
cout << title << endl;
|
cout << title << endl;
|
||||||
}
|
}
|
||||||
|
delete searcher;
|
||||||
|
kiwix::CluceneSearcher::terminate();
|
||||||
} else {
|
} else {
|
||||||
cerr << "Unable instanciate the Kiwix searcher." << endl;
|
cerr << "Unable instanciate the Kiwix searcher." << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user