mirror of https://github.com/kiwix/libkiwix.git
+ removing of the result sidebar
This commit is contained in:
parent
9e8ebdaf6e
commit
5e162d6f47
|
@ -35,7 +35,6 @@ namespace kiwix {
|
||||||
}
|
}
|
||||||
|
|
||||||
searchInIndex(removeAccents(search), resultsCount, verbose);
|
searchInIndex(removeAccents(search), resultsCount, verbose);
|
||||||
|
|
||||||
this->resultOffset = this->results.begin();
|
this->resultOffset = this->results.begin();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -72,10 +71,9 @@ namespace kiwix {
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Searcher::searchInIndexAndReturnHtml(string &search, const unsigned int resultsCount,
|
const string Searcher::getHtml() {
|
||||||
const string templatePath, const bool verbose) {
|
|
||||||
|
|
||||||
const STLW::string & sSourceFile = "/tmp/hello.tmpl";
|
const STLW::string & sSourceFile = "/var/www/kiwix/moulinkiwix/templates/results.tmpl";
|
||||||
VMOpcodeCollector oVMOpcodeCollector;
|
VMOpcodeCollector oVMOpcodeCollector;
|
||||||
StaticText oSyscalls;
|
StaticText oSyscalls;
|
||||||
StaticData oStaticData;
|
StaticData oStaticData;
|
||||||
|
@ -118,15 +116,17 @@ namespace kiwix {
|
||||||
// Fill data
|
// Fill data
|
||||||
CDT oData;
|
CDT oData;
|
||||||
CDT resultsCDT(CDT::ARRAY_VAL);
|
CDT resultsCDT(CDT::ARRAY_VAL);
|
||||||
CDT result1;
|
|
||||||
result1["title"] = "title1";
|
|
||||||
result1["url"] = "url1";
|
|
||||||
CDT result2;
|
|
||||||
result2["title"] = "title2";
|
|
||||||
result2["url"] = "url2";
|
|
||||||
|
|
||||||
resultsCDT[0] = result1;
|
this->resultOffset = this->results.begin();
|
||||||
resultsCDT[1] = result2;
|
while (this->resultOffset != this->results.end()) {
|
||||||
|
CDT result;
|
||||||
|
result["title"] = this->resultOffset->title;
|
||||||
|
result["url"] = this->resultOffset->url;
|
||||||
|
resultsCDT.PushBack(result);
|
||||||
|
this->resultOffset++;
|
||||||
|
}
|
||||||
|
this->resultOffset = this->results.begin();
|
||||||
|
|
||||||
oData["results"] = resultsCDT;
|
oData["results"] = resultsCDT;
|
||||||
|
|
||||||
STLW::string sResult;
|
STLW::string sResult;
|
||||||
|
|
|
@ -62,8 +62,7 @@ namespace kiwix {
|
||||||
void search(std::string &search, const unsigned int resultsCount, const bool verbose=false);
|
void search(std::string &search, const unsigned int resultsCount, const bool verbose=false);
|
||||||
bool getNextResult(string &url, string &title, unsigned int &score);
|
bool getNextResult(string &url, string &title, unsigned int &score);
|
||||||
void reset();
|
void reset();
|
||||||
const string searchInIndexAndReturnHtml(string &search, const unsigned int resultsCount,
|
const string getHtml();
|
||||||
const string templatePath, const bool verbose=false);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeIndex() = 0;
|
virtual void closeIndex() = 0;
|
||||||
|
|
Loading…
Reference in New Issue