How to improve search functionality in SuiteCRM 8.2 without using ElasticSearch

Hello everyone,

I just installed SuiteCRM 8.2 on my server and I am discovering this great solution. However, I have a problem with searching in the application. I find that it is not possible to get results similar to a “LIKE %%” SQL query, and it seems that we have to know the beginning of a contact or account to be able to find it.

Example -

  • Account name : APHP HĂ´pital
    Can be found with “ap” letters but no result with “hp” letters only.

I have seen that SuiteCRM 8 can be improved with ElasticSearch, but this solution seems to be very resource-consuming (at least 16 GB) and it is beyond my means to set up a dedicated server of this type at the moment.

Has anyone ever encountered this problem and found a way to bypass this search limitation? I am really interested in any ideas and tips you may have on this topic.

Thank you in advance for your help!

Did you try the following optin in config.php?
‘search_wildcard_infront’ => true,

2 Likes

Thanks a lot, it was the option needed :slight_smile:

Are there any other methods to improve search without Elashticsearch? :thinking:

I often have to add some fields to the global search. Unfortunately, that’s via code only:

And then, there are the search settings in the admin area, which might help in specific cases:

2 Likes

Based on your video, I have successfully added some of the fields to my global search.

Now, the issue I have is that there are couple of custom fields which I also want to add to my global search and I do not see definition of this fields in my SearchFields.php file.

So the question is how to add custom fields to the search as well?

Ignore above, the solution is that I need to manually add definition of my field(s) in SearchFields.php file and correct name of the field I can find in Studio.

Rest of the procedure is exactly the same as with default fields.

(posting this for future reference, so that others with same problem find solution)

2 Likes

@mrak could you please the code example? :face_with_peeking_eye: :sweat_smile:

We have custom module and we added it to the global search but when we try to search values from that module. We do not get any records.

No problem, here is additional line added to “phone” variable:

Screenshot 2025-04-08 153602

As you can see, I have added force_unifiedsearch flag (as is explained in above thread as well as Bastians video (see the video, it is easy to follow and all steps are there).

If you have custom variable, you need to find exact name of the variable in your studio and then add in appropriate place (I would suggest at the beginning of the file or at the end so it is easier to find later):

Here is code example:

 'first_name' =>
  array (
    'query_type' => 'default',
  ),
**'offer_number_c' =>**
**   array (**
**     'query_type' => 'default',**
**     'force_unifiedsearch'=>true,**
**   ),**
  'last_name' =>
  array (
    'query_type' => 'default',
  ),

So, in my example I have a custom added field called offer_number_c and I needed to add whole definition for that particular field including force_unified search flag (see lines with two asterisk in front, asterisks here are just to point the lines of interest, there are no asterisks in the file itself).

All of this is happening in /var/www/suitecrm/public/legacy/custom/modules/Contacts/metadata/SearchFields.php, note that exact position might vary from one installation to another (here is within /var/www but it might be somewhere else such as /home/www or something similar. Ah, and all of this is for my Contacts module, if you have fields elsewhere (Accounts, Leads) you need to make changes in coresponding folder.

Important note is that you need to do all this additions and changes within custom/modules in order to keep this changes in future upgrades (and you need to do repair before seeing results).

1 Like

Thank you so much for the detailed and great answer. I will give it a try! :smile: :smiley:


For some reason, it is not working for us in the custom module.

1 Like