I have a Search controller that handles search-related tasks in my
project and one of the requirements is that given a query (let's say
$query) it should search for $query in table a (model A), table b
(model B), table c (model C), and table d (model D). This Search
controller DOES NOT have a Search model associated with it (was not
needed). It instead sets $uses = array('A','B','C','D'). It has to
search using MySQL's fulltext search.
Right now I'm trying to get it working with only 2 of the 4 models
(because it'll be easy to expand out to 4 once I get this working)
Currently what I have is this (all in search_controller.php):
var $paginate = array('fields' => array('A.id', 'A.title',
'A.second'));
And my pagination does this:
$this->paginate('A', array("1" =>
"1 AND WHERE MATCH(A.title,A.second) AGAINST('{$query}' IN BOOLEAN
MODE ) UNION SELECT `B`.`id`, `B`.`name`, `B`.`type` FROM `b` AS `B`
WHERE 1 AND MATCH(`B`.`name`) AGAINST('$query' IN BOOLEAN MODE )"
));
Naturally I get an error because the query it uses to do count(*)
fails. I would override the entire pagination thing if I had a model
to override (I can't override A and B's pagination because I want it
to work normally for other things).
So is there anyway I can do this or do I have to resort to hacking
stuff to get my functionality?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---