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:
Maneesh P M
2021-05-17 19:23:43 +05:30
committed by Matthieu Gautier
parent c35f6f9142
commit e2f6d91d51
3 changed files with 1 additions and 9 deletions

View File

@ -77,9 +77,7 @@ std::string SearchRenderer::getHtml()
result.set("title", p_result->get_title());
result.set("url", p_result->get_url());
result.set("snippet", p_result->get_snippet());
auto readerIndex = p_result->get_readerIndex();
auto reader = mp_searcher->get_reader(readerIndex);
result.set("resultContentId", mp_nameMapper->getNameForId(reader->getId()));
result.set("resultContentId", mp_nameMapper->getNameForId(p_result->get_zimId()));
if (p_result->get_wordCount() >= 0) {
result.set("wordCount", kiwix::beautifyInteger(p_result->get_wordCount()));