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:
Matthieu Gautier 2017-11-27 12:37:13 +00:00
parent 189c972d17
commit 64dc5131c0
2 changed files with 6 additions and 5 deletions

View File

@ -56,7 +56,7 @@ struct SearcherInternal;
class Searcher
{
public:
Searcher();
Searcher(const string& humanReadableName = "");
Searcher(const string& xapianDirectoryPath,
Reader* reader,
const string& humanReadableName);

View File

@ -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();
}