mirror of https://github.com/kiwix/libkiwix.git
Remove get_readerIndex in favor of get_zimId
The function get_readerIndex was used to get the zimId using an ordered vector of readers. Now we can use get_zimId directly.
This commit is contained in:
parent
c35f6f9142
commit
e2f6d91d51
|
@ -48,7 +48,6 @@ class Result
|
||||||
virtual std::string get_content() = 0;
|
virtual std::string get_content() = 0;
|
||||||
virtual int get_wordCount() = 0;
|
virtual int get_wordCount() = 0;
|
||||||
virtual int get_size() = 0;
|
virtual int get_size() = 0;
|
||||||
virtual int get_readerIndex() = 0;
|
|
||||||
virtual std::string get_zimId() = 0;
|
virtual std::string get_zimId() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,7 @@ std::string SearchRenderer::getHtml()
|
||||||
result.set("title", p_result->get_title());
|
result.set("title", p_result->get_title());
|
||||||
result.set("url", p_result->get_url());
|
result.set("url", p_result->get_url());
|
||||||
result.set("snippet", p_result->get_snippet());
|
result.set("snippet", p_result->get_snippet());
|
||||||
auto readerIndex = p_result->get_readerIndex();
|
result.set("resultContentId", mp_nameMapper->getNameForId(p_result->get_zimId()));
|
||||||
auto reader = mp_searcher->get_reader(readerIndex);
|
|
||||||
result.set("resultContentId", mp_nameMapper->getNameForId(reader->getId()));
|
|
||||||
|
|
||||||
if (p_result->get_wordCount() >= 0) {
|
if (p_result->get_wordCount() >= 0) {
|
||||||
result.set("wordCount", kiwix::beautifyInteger(p_result->get_wordCount()));
|
result.set("wordCount", kiwix::beautifyInteger(p_result->get_wordCount()));
|
||||||
|
|
|
@ -45,7 +45,6 @@ class _Result : public Result
|
||||||
virtual std::string get_content();
|
virtual std::string get_content();
|
||||||
virtual int get_wordCount();
|
virtual int get_wordCount();
|
||||||
virtual int get_size();
|
virtual int get_size();
|
||||||
virtual int get_readerIndex();
|
|
||||||
virtual std::string get_zimId();
|
virtual std::string get_zimId();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -262,10 +261,6 @@ int _Result::get_wordCount()
|
||||||
{
|
{
|
||||||
return iterator.getWordCount();
|
return iterator.getWordCount();
|
||||||
}
|
}
|
||||||
int _Result::get_readerIndex()
|
|
||||||
{
|
|
||||||
return iterator.getFileIndex();
|
|
||||||
}
|
|
||||||
std::string _Result::get_zimId()
|
std::string _Result::get_zimId()
|
||||||
{
|
{
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
|
|
Loading…
Reference in New Issue