title: Search feature for cakephp
body: <p>I wanted to implement a search feature in my cakephp application.  I found this article for implementing cakephp search. 
  <a href="http://bakery.cakephp.org/articles/view/search-feature-to-cakephp-blog-example" rel="nofollow noreferrer">http://bakery.cakephp.org/articles/view/search-feature-to-cakephp-blog-example</a></p>
  
  <p>It had a google code repository found here:
  <a href="http://code.google.com/p/searchable-behaviour-for-cakephp/" rel="nofollow noreferrer">http://code.google.com/p/searchable-behaviour-for-cakephp/</a></p>
  
  <p>Things seemed to work okay until I ran into an issue trying to save a search able model from another controller.</p>
  
  <ol>
  <li>Model A and Model B are search able</li>
  <li>From Controller A, I call $this->Model B->save</li>
  </ol>
  
  <p>Index fails and throws error because searchable.php behavior is trying to
  use Model A as the saving Model</p>
  
  <p>I posted this on the issue board of the google code page for this feature, but I have received no responses.  I figured that I would give stackoverflow a shot.</p>
  
  <p>Thanks!</p>
  
  <p>I do have this line in Model A and Model B
  var $actsAs = array('Searchable');</p>
  
  <p>These two models do no have any direct relationships</p>
  
  <p>Call from Controller A
  $this->Model B->create();
  $this->Model B->save($this->data, array('validate' => 'false'));</p>
  
  <p>Error I'm receiving
  Warning (2): Invalid argument supplied for foreach() [APP/models/behaviors/searchable.php, line 86]</p>
  
  <p>frodosghost, does this functionality work in your environment?</p>