mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 03:52:35 -04:00
Merge pull request #64 from kiwix/fix_protocol
Correctly set ProtocolPrefix and SearchProtocolPrefix for searcher.
This commit is contained in:
commit
f44722fbbc
@ -86,10 +86,11 @@ int main(int argc, char** argv)
|
||||
}
|
||||
|
||||
if (reader) {
|
||||
searcher = new kiwix::Searcher("", reader);
|
||||
searcher = new kiwix::Searcher();
|
||||
searcher->add_reader(reader, "");
|
||||
} else {
|
||||
try {
|
||||
searcher = new kiwix::Searcher(zimPath, NULL);
|
||||
searcher = new kiwix::Searcher(zimPath, NULL, "");
|
||||
} catch (...) {
|
||||
cerr << "Unable to search through zim '" << zimPath << "'." << endl;
|
||||
exit(1);
|
||||
|
@ -942,15 +942,16 @@ int main(int argc, char** argv)
|
||||
|
||||
if ( reader->hasFulltextIndex()) {
|
||||
kiwix::Searcher* searcher = new kiwix::Searcher();
|
||||
searcher->setProtocolPrefix("/");
|
||||
searcher->setSearchProtocolPrefix("/search?");
|
||||
searcher->add_reader(reader, humanReadableId);
|
||||
globalSearcher->add_reader(reader, humanReadableId);
|
||||
searchers[humanReadableId] = searcher;
|
||||
} else if ( !indexPath.empty() ) {
|
||||
try {
|
||||
kiwix::Searcher* searcher = new kiwix::Searcher(indexPath, reader);
|
||||
kiwix::Searcher* searcher = new kiwix::Searcher(indexPath, reader, humanReadableId);
|
||||
searcher->setProtocolPrefix("/");
|
||||
searcher->setSearchProtocolPrefix("/search?");
|
||||
searcher->setContentHumanReadableId(humanReadableId);
|
||||
searchers[humanReadableId] = searcher;
|
||||
} catch (...) {
|
||||
cerr << "Unable to open the search index '" << indexPath << "'."
|
||||
|
Loading…
x
Reference in New Issue
Block a user