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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Searcher::setContentHumanReadableId(const string &contentHumanReadableId) {
|
||||||
|
this->contentHumanReadableId = contentHumanReadableId;
|
||||||
|
}
|
||||||
|
|
||||||
string Searcher::getHtml() {
|
string Searcher::getHtml() {
|
||||||
|
|
||||||
const STLW::string & sSourceFile = this->resultTemplatePath;
|
const STLW::string & sSourceFile = this->resultTemplatePath;
|
||||||
|
@ -171,7 +175,7 @@ namespace kiwix {
|
||||||
while (this->resultOffset != this->results.end()) {
|
while (this->resultOffset != this->results.end()) {
|
||||||
CDT result;
|
CDT result;
|
||||||
result["title"] = this->resultOffset->title;
|
result["title"] = this->resultOffset->title;
|
||||||
result["url"] = this->resultOffset->url;
|
result["url"] = this->contentHumanReadableId + "/" + this->resultOffset->url;
|
||||||
result["snippet"] = this->resultOffset->snippet;
|
result["snippet"] = this->resultOffset->snippet;
|
||||||
|
|
||||||
if (this->resultOffset->size >= 0)
|
if (this->resultOffset->size >= 0)
|
||||||
|
|
|
@ -74,6 +74,7 @@ namespace kiwix {
|
||||||
bool setSearchProtocolPrefix(const std::string prefix);
|
bool setSearchProtocolPrefix(const std::string prefix);
|
||||||
string getHtml();
|
string getHtml();
|
||||||
void reset();
|
void reset();
|
||||||
|
void setContentHumanReadableId(const string &contentHumanReadableId);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string beautifyInteger(const unsigned int number);
|
std::string beautifyInteger(const unsigned int number);
|
||||||
|
@ -91,6 +92,7 @@ namespace kiwix {
|
||||||
unsigned int resultEnd;
|
unsigned int resultEnd;
|
||||||
std::string protocolPrefix;
|
std::string protocolPrefix;
|
||||||
std::string searchProtocolPrefix;
|
std::string searchProtocolPrefix;
|
||||||
|
std::string contentHumanReadableId;
|
||||||
unsigned int resultRange;
|
unsigned int resultRange;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue