Hi,
I have a strange issue with one of my sites. The site is a huge catalog with food recipes and it has a search service. All recipes are written in cyrillic so the string for the search has cyrillics letters.
In the controller I have:
if(!isset($_GET['q']) || strlen($_GET['q'])<3) {
$this->render('search', array('err'=>'Search string is missing or it should contains more than 3 letters, bla bla'));
return;
}
$results = $this->search->search($_GET['q']); // this is a lucene search engine and it returns only IDs of real database records
$ids = array();
foreach($results["results"] as $r) {
$ids[] = $r->record_id;
}
$criteria = new CDbCriteria;
$criteria->addInCondition('id', $ids);
$dataProvider = new CActiveDataProvider('Recipes', array (
'criteria' => $criteria,
'pagination' => array (
'PageSize' => 2,
)
));
$this->render('search', array(
'dataProvider'=>$dataProvider,
));
In the view I have:
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_search_result',
'enableHistory' => true,
));
In general it is not some special. This is the usual way to use this functionality. When I tried to search something for example "риба" (this is a fish in Bulgarian language) first page is correct as it should be. I cannot manage to change the page from the pager. Only the first page works. For the other pages search string which is a GET parameter is changed to something unreadable. It may be a encoding issue, I do not know.
For first page my url is: mydomain.com/search/search?q=риба and it is valid.
After using the paged …
For the second page my url is: mydimain.com/search/search?q=Ñиба&Recipes_page=2 instead of mydomain.com/search/search?q=риба&Recipes_page=2 and it does not work.
do you have any idea how I can fix this issue