mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
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:
parent
5989146931
commit
7776eafbfc
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user