mirror of https://github.com/kiwix/libkiwix.git
+ last improvement of the new kiwix-serve
This commit is contained in:
parent
54cb99d074
commit
8f69987929
|
@ -121,6 +121,10 @@ namespace kiwix {
|
|||
return true;
|
||||
}
|
||||
|
||||
void Searcher::setContentHumanReadableId(const string &contentHumanReadableId) {
|
||||
this->contentHumanReadableId = contentHumanReadableId;
|
||||
}
|
||||
|
||||
string Searcher::getHtml() {
|
||||
|
||||
const STLW::string & sSourceFile = this->resultTemplatePath;
|
||||
|
@ -171,7 +175,7 @@ namespace kiwix {
|
|||
while (this->resultOffset != this->results.end()) {
|
||||
CDT result;
|
||||
result["title"] = this->resultOffset->title;
|
||||
result["url"] = this->resultOffset->url;
|
||||
result["url"] = this->contentHumanReadableId + "/" + this->resultOffset->url;
|
||||
result["snippet"] = this->resultOffset->snippet;
|
||||
|
||||
if (this->resultOffset->size >= 0)
|
||||
|
|
|
@ -74,6 +74,7 @@ namespace kiwix {
|
|||
bool setSearchProtocolPrefix(const std::string prefix);
|
||||
string getHtml();
|
||||
void reset();
|
||||
void setContentHumanReadableId(const string &contentHumanReadableId);
|
||||
|
||||
protected:
|
||||
std::string beautifyInteger(const unsigned int number);
|
||||
|
@ -91,6 +92,7 @@ namespace kiwix {
|
|||
unsigned int resultEnd;
|
||||
std::string protocolPrefix;
|
||||
std::string searchProtocolPrefix;
|
||||
std::string contentHumanReadableId;
|
||||
unsigned int resultRange;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue