I'm working on a module to make certain CMS pages searchable on the front end. Right now I'm having a little trouble filtering the pages. I get the collection, filter it by an "is_searchable" field that I've added, which is working fine. When I try to filter it by title or content using a like statement, it either returns no results, or every result, regardless of if that matches the title/content at all or not. Here's what I'm using so far:
$results = Mage::getModel('cms/page')->getCollection()
->addFieldToFilter('title', array('like'=> '%' . $search . '%'))
->addFieldToFilter('content', array('like'=>'%' . $search . '%'))
->addFieldToFilter('is_searchable', 1);
I also tried using addAttributeToFilter() but get an error that that function doesn't exist in that model. Not sure what I'm doing wrong here, but any help or direction would be appreciated. Thanks!