Correctly set ProtocolPrefix and SearchProtocolPrefix for searcher.

Default `protocolPrefix` for the kiwix-lib searcher is `zim:://`.
We have to change it to `/` for all searcher we create else the search's
results will have a `zim://...` url, which will obviously won't work.
This commit is contained in:
Matthieu Gautier 2017-08-09 18:18:02 -04:00
parent 5989146931
commit 7776eafbfc

View File

@ -942,6 +942,8 @@ int main(int argc, char** argv)
if ( reader->hasFulltextIndex()) { if ( reader->hasFulltextIndex()) {
kiwix::Searcher* searcher = new kiwix::Searcher(); kiwix::Searcher* searcher = new kiwix::Searcher();
searcher->setProtocolPrefix("/");
searcher->setSearchProtocolPrefix("/search?");
searcher->add_reader(reader, humanReadableId); searcher->add_reader(reader, humanReadableId);
globalSearcher->add_reader(reader, humanReadableId); globalSearcher->add_reader(reader, humanReadableId);
searchers[humanReadableId] = searcher; searchers[humanReadableId] = searcher;