So I'm using a similar query to what CodeGuerilla posted:
$results = DataObject::get('Product',
"Title LIKE '%".$this->searchEntry."%' ".
"OR Brand LIKE '%".$this->searchEntry."%' ".
"OR PartNumber LIKE '%".$this->searchEntry."%' ".
"OR MetaTitle LIKE '%".$this->searchEntry."%' ".
"OR MetaDescription LIKE '%".$this->searchEntry."%' ".
"OR FIND_IN_SET('".trim($this->searchEntry)."', `MetaKeywords`) > 0", "Title ASC", NULL, "{$SQL_start},".Page::$resultsPerPage);
with an additional AND clause like: AND (ClassName = 'Lorem' OR ClassName = 'Ipsum')
Everything works great, but I would like to enhance the query:
So let's say class 'Lorem' has a child class 'LoremChild'. I would like to modify the query so that it returns 'Lorem' items where any of it's children also have Title LIKE OR Brand LIKE, etc. I don't want the actual child item to be returned in the query, only the parent 'Lorem' item. Any help on this query is greatly appreciated!