Filtering By Keywords

Permalink
This is more of a MySQL question than a c5 question, so forgive my lack of DB syntax knowledge.

Why do the UserList and PageList filters use .'s in their queries?

Example:
public function filterByKeywords($keywords) {
   $db = Loader::db();
   $qkeywords = $db->quote('%' . $keywords . '%');
   $keys = UserAttributeKey::getSearchableIndexedList();
   $emailSearchStr=' OR u.uEmail like '.$qkeywords.' ';   
   $attribsStr = '';
   foreach ($keys as $ak) {
      $cnt = $ak->getController();         
      $attribsStr.=' OR ' . $cnt->searchKeywords($keywords);
   }
   $this->filter(false, '( u.uName like ' . $qkeywords . $emailSearchStr . $attribsStr . ')');
}
And:
public function filterByKeywords($keywords) {
   $db = Loader::db();
   $kw = $db->quote($keywords);
   $qk = $db->quote('%' . $keywords . '%');
   $this->indexedSearch = true;
   $this->indexedKeywords = $keywords;
   $this->autoSortColumns[] = 'cIndexScore';
   Loader::model('attribute/categories/collection');      
   $keys = CollectionAttributeKey::getSearchableIndexedList();
   $attribsStr = '';
   foreach ($keys as $ak) {
      $cnt = $ak->getController();         
      $attribsStr.=' OR ' . $cnt->searchKeywords($keywords);
   }
   $this->filter(false, "((match(psi.cName, psi.cDescription, psi.content) against ({$kw})) {$attribsStr})");

Notice the 'u.uEmail' and 'u.uName' in the UserList example and 'psi.cName', etc... in the PageList example.

What are the prefixes for and how can they be taken advantage of?

Thanks!
- IJ

ijessup
 
ijessup replied on at Permalink Best Answer Reply
ijessup