We have a locally installed copy of Sugar CRM but the search works horribly! There is an "Account" with the name: "Dr. John Smith", and if you search for "Smith" that account won't show up in the results. How can you improve or "fix" the search field of Sugar CRM?
2 Answers
I ran into this today. You have to use SQL wildcards. EG Search for '%Smith' and that will get you all Accounts that end in Smith OR search for '%Smith%' and you get get all Accounts that contain 'Smith' anywhere in the name.
Sugar should change this to just always search in phrase rather than search exact phrase that starts with.
I had the same problem and solved it by the following code: (Using SugarCRM 6.5.20 CE)
Change the line 1081 of file "./include/SearchForm/SearchForm2.php" from:
$where .= $db_field . " like ".$this->seed->db->quoted(sql_like_string($field_value, $like_char));
to:
$where .= $db_field . " like ".$this->seed->db->quoted(sql_like_string("%" . $field_value, $like_char));
this fixed the problem for me.