diff --git a/src/common/kiwix/searcher.cpp b/src/common/kiwix/searcher.cpp index 2d95a8ac5..26ab55e0c 100644 --- a/src/common/kiwix/searcher.cpp +++ b/src/common/kiwix/searcher.cpp @@ -43,6 +43,7 @@ namespace kiwix { estimatedResultCount(0), resultStart(0), resultEnd(0), + resultRange(20), protocolPrefix("zim://"), searchProtocolPrefix("search://?") { } @@ -213,6 +214,8 @@ namespace kiwix { oData["searchPattern"] = this->searchPattern; oData["resultStart"] = this->resultStart + 1; oData["resultEnd"] = (this->resultEnd > this->estimatedResultCount ? this->estimatedResultCount : this->resultEnd); + oData["resultRange"] = this->resultRange; + oData["resultLastPageStart"] = this->estimatedResultCount - this->resultRange; oData["protocolPrefix"] = this->protocolPrefix; oData["searchProtocolPrefix"] = this->searchProtocolPrefix; diff --git a/src/common/kiwix/searcher.h b/src/common/kiwix/searcher.h index 1ed7afaa3..bdc0700cb 100644 --- a/src/common/kiwix/searcher.h +++ b/src/common/kiwix/searcher.h @@ -91,6 +91,7 @@ namespace kiwix { unsigned int resultEnd; std::string protocolPrefix; std::string searchProtocolPrefix; + unsigned int resultRange; }; } diff --git a/static/results.tmpl b/static/results.tmpl index 5734502b8..a6711f80e 100644 --- a/static/results.tmpl +++ b/static/results.tmpl @@ -114,9 +114,15 @@