mirror of https://github.com/kiwix/libkiwix.git
Be able to specify the global contentHumanReadableId without a index.
Even if we use the add_reader method to search into embedded full text index, we need to specify the global `contentHumanReadableId` as it will be used to generate "page links".
This commit is contained in:
parent
189c972d17
commit
64dc5131c0
|
@ -56,7 +56,7 @@ struct SearcherInternal;
|
|||
class Searcher
|
||||
{
|
||||
public:
|
||||
Searcher();
|
||||
Searcher(const string& humanReadableName = "");
|
||||
Searcher(const string& xapianDirectoryPath,
|
||||
Reader* reader,
|
||||
const string& humanReadableName);
|
||||
|
|
|
@ -85,17 +85,17 @@ Searcher::Searcher(const string& xapianDirectoryPath,
|
|||
resultCountPerPage(0),
|
||||
estimatedResultCount(0),
|
||||
resultStart(0),
|
||||
resultEnd(0)
|
||||
resultEnd(0),
|
||||
contentHumanReadableId(humanReadableName)
|
||||
{
|
||||
loadICUExternalTables();
|
||||
if (!reader || !reader->hasFulltextIndex()) {
|
||||
internal->_xapianSearcher = new XapianSearcher(xapianDirectoryPath, reader);
|
||||
}
|
||||
this->contentHumanReadableId = humanReadableName;
|
||||
this->humanReaderNames.push_back(humanReadableName);
|
||||
}
|
||||
|
||||
Searcher::Searcher()
|
||||
Searcher::Searcher(const std::string& humanReadableName)
|
||||
: internal(new SearcherInternal()),
|
||||
searchPattern(""),
|
||||
protocolPrefix("zim://"),
|
||||
|
@ -103,7 +103,8 @@ Searcher::Searcher()
|
|||
resultCountPerPage(0),
|
||||
estimatedResultCount(0),
|
||||
resultStart(0),
|
||||
resultEnd(0)
|
||||
resultEnd(0),
|
||||
contentHumanReadableId(humanReadableName)
|
||||
{
|
||||
loadICUExternalTables();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue