Search related table?

How Do I perform a search on a related table? Something like:


$criteria=new CDbCriteria;

                $criteria->with=array(

                    'pages.content',

                );

                $criteria->condition = 'pages.content LIKE :keyword';

                $criteria->params = array(':keyword' => '%'.$q.'%');


                $bookCount = Books::model()->count($criteria);

                $pagination = new CPagination($bookCount);

                $pagination->pageSize = 10;

                $pagination->applyLimit($criteria);


                $books = Books::model()->findAll($criteria);

Does not work :(

try:


	$criteria->with=array(

		'pages'=>array(

			'condition' => 'content LIKE :keyword',

		),

	);

Can you post your search action controller