+ last improvement of the new kiwix-serve

This commit is contained in:
kelson42 2012-04-16 23:21:37 +00:00
parent 54cb99d074
commit 8f69987929
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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;
};