diff --git a/include/searcher.h b/include/searcher.h index 3a1950cab..4f07c0796 100644 --- a/include/searcher.h +++ b/include/searcher.h @@ -56,7 +56,7 @@ struct SearcherInternal; class Searcher { public: - Searcher(); + Searcher(const string& humanReadableName = ""); Searcher(const string& xapianDirectoryPath, Reader* reader, const string& humanReadableName); diff --git a/src/searcher.cpp b/src/searcher.cpp index ca8f8e415..4010bdc87 100644 --- a/src/searcher.cpp +++ b/src/searcher.cpp @@ -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(); }