Yii Solr Problems On Clistview

Hi,

I use the yii-solr extension to handle solr search with yii and models.

My solr results are renderd insight an CListView Element.

The yii solr model runs with an additional Parameter:


$configDataProvder["criteria"]->addParam('fq','parent_id:bd2a');

The CListView ajaxUpdate option is enabled ajaxUpdate=true

The initial CListView listing works fine.

If I use pagination (if i change the page), CListView fails and returns an Solr 400 Error (bad request).

Looking at the solr log: i see, that my additional parameter is set in the solr url, BUT it’s empty


http://my.host:8080/solr/....&fq=parent_id:&start=30 ......

So the question is: why the additional Parameter is empty?

And 2nd Question: is there an better way to use fq parameter than the "addParm" feature, which I use?

Thank you, rall0r

To answer my own question - maybe someone has the same issue.

The problem is not an Yii Solr problem.

The point is, that the CListView update URL used an specific parameter (ID):


http://.....index.php/controller/action/id/bd2a

As you can see, i use an URL rule to rewrite the url to change from


http://.....index.php?r=controller/action&id=bd2a

to


http://.....index.php/controller/action/id/bd2a

This feature is provided by Yii, if you uncomment the following lines at the config/main.php


		'urlManager'=>array(

			'urlFormat'=>'path',

			'rules'=>array(

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',

				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

			),

		),

As you can see: there is an rewrite rule for "id" as a part of the url.

It looks like, "id" is an reserved GET-Parameter in Yii.

Because I doesn’t know that, I used the id parameter for my application. Because of that URL Mangaer rule, the, URLs where generated like this:


http://.....index.php/controller/action/bd2a

…as you can see: the "id" was removed.

This war the reason, why CListView and Yii Solr does not work correctly.