| Line 554... |
Line 554... |
| 554 |
public function newsearch(){
|
554 |
public function newsearch(){
|
| 555 |
$q = $this->request->query('q');
|
555 |
$q = $this->request->query('q');
|
| 556 |
$this->layout = 'innerpages';
|
556 |
$this->layout = 'innerpages';
|
| 557 |
$page = $this->request->query('page');
|
557 |
$page = $this->request->query('page');
|
| 558 |
if (isset($page)){
|
558 |
if (isset($page)){
|
| 559 |
$page= (int)($this->request->query('page'));
|
559 |
$page=(int)($this->request->query('page'));
|
| 560 |
}else {
|
560 |
}else {
|
| 561 |
$page=1;
|
561 |
$page=1;
|
| 562 |
}
|
562 |
}
|
| 563 |
$offset = ($page-1)*20;
|
563 |
$offset = ($page-1)*20;
|
| 564 |
$url = $this->solrapihost."solr-search!getSearchResults?search_text=".urlencode($q)."&offset=".$offset;
|
564 |
$url = $this->solrapihost."solr-search!getSearchResults?search_text=".urlencode($q)."&offset=".$offset;
|
| Line 577... |
Line 577... |
| 577 |
}
|
577 |
}
|
| 578 |
$offset = ($page - 1)*20;
|
578 |
$offset = ($page - 1)*20;
|
| 579 |
// $noti='[{"title": "Riviera Series J Battery For Micromax A240","id": "28750"}]';
|
579 |
// $noti='[{"title": "Riviera Series J Battery For Micromax A240","id": "28750"}]';
|
| 580 |
// $result = json_decode($noti,1);
|
580 |
// $result = json_decode($noti,1);
|
| 581 |
|
581 |
|
| 582 |
$url = $this->pythonapihost."dtr/solr-search!getSearchResults?search_text=".urlencode($ser)."&offset=".$offset;
|
582 |
$url = $this->solrapihost."solr-search!getSearchResults?search_text=".urlencode($ser)."&offset=".$offset;
|
| 583 |
$result = $this->make_request($url, null);
|
583 |
$result = $this->make_request($url, null);
|
| 584 |
|
584 |
|
| 585 |
$nexturl = "/store_products/nextsearch?page=".($page+1)."&search_text=".urlencode($ser);
|
585 |
$nexturl = "/store_products/nextsearch?page=".($page+1)."&search_text=".urlencode($ser);
|
| 586 |
$this->set(compact('result','nexturl'));
|
586 |
$this->set(compact('result','nexturl'));
|
| 587 |
$this->render('/Elements/newsearchresult');
|
587 |
$this->render('/Elements/newsearchresult');
|