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
|
class Searcher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Searcher();
|
Searcher(const string& humanReadableName = "");
|
||||||
Searcher(const string& xapianDirectoryPath,
|
Searcher(const string& xapianDirectoryPath,
|
||||||
Reader* reader,
|
Reader* reader,
|
||||||
const string& humanReadableName);
|
const string& humanReadableName);
|
||||||
|
|
|
@ -85,17 +85,17 @@ Searcher::Searcher(const string& xapianDirectoryPath,
|
||||||
resultCountPerPage(0),
|
resultCountPerPage(0),
|
||||||
estimatedResultCount(0),
|
estimatedResultCount(0),
|
||||||
resultStart(0),
|
resultStart(0),
|
||||||
resultEnd(0)
|
resultEnd(0),
|
||||||
|
contentHumanReadableId(humanReadableName)
|
||||||
{
|
{
|
||||||
loadICUExternalTables();
|
loadICUExternalTables();
|
||||||
if (!reader || !reader->hasFulltextIndex()) {
|
if (!reader || !reader->hasFulltextIndex()) {
|
||||||
internal->_xapianSearcher = new XapianSearcher(xapianDirectoryPath, reader);
|
internal->_xapianSearcher = new XapianSearcher(xapianDirectoryPath, reader);
|
||||||
}
|
}
|
||||||
this->contentHumanReadableId = humanReadableName;
|
|
||||||
this->humanReaderNames.push_back(humanReadableName);
|
this->humanReaderNames.push_back(humanReadableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Searcher::Searcher()
|
Searcher::Searcher(const std::string& humanReadableName)
|
||||||
: internal(new SearcherInternal()),
|
: internal(new SearcherInternal()),
|
||||||
searchPattern(""),
|
searchPattern(""),
|
||||||
protocolPrefix("zim://"),
|
protocolPrefix("zim://"),
|
||||||
|
@ -103,7 +103,8 @@ Searcher::Searcher()
|
||||||
resultCountPerPage(0),
|
resultCountPerPage(0),
|
||||||
estimatedResultCount(0),
|
estimatedResultCount(0),
|
||||||
resultStart(0),
|
resultStart(0),
|
||||||
resultEnd(0)
|
resultEnd(0),
|
||||||
|
contentHumanReadableId(humanReadableName)
|
||||||
{
|
{
|
||||||
loadICUExternalTables();
|
loadICUExternalTables();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue