Custom Module Search Features Inquiry/Issue

Does anyone know how to get the Global Search feature to return a wider range of results? I was able to get the search feature to work for my custom modules; however, it only returns results if the full name in the field being searched is provided.

For example, I have one custom module for “Hosting Providers.” When I search for (let’s say) a Network Solutions entry, if I don’t search for “Network Solutions” exactly, nothing appears in the search results. I would like to be able to type “Network” and see all of the Network Solutions entries. Is there a way to do this?


My current set up is as follows:

  1. I have a new file under the custom/Extension/modules/YOUR_MODULE/Ext/Vardefs/customGlobalSearchFields.php directory with the following contents:
<?php $dictionary['YOUR_MODULE']['fields']['NAME_OF_FIELD_TO_SEARCH']['unified_search'] = true; ex. $dictionary['Account']['fields']['accounts_id_c']['unified_search'] = true;

2.Then, I added a search definition for the file, which I specified in the custom/modules/YOUR_MODULE/metadata/SearchFields.php file as shown below : <?php $searchFields['YOUR_MODULE']['NAME_OF_FIELD_TO_SEARCH'] = array( 'query_type'=>'default'); ______________________________
Any help that anyone can provide would be greatly appreciated. Thank you in advance! :smiley:

Use % as a wildcard character, for example “Sales%”

Oh, my gosh! I didn’t realize that was a possibility. You’re a genius. Thank you so much for your help, @pgr :smiley:

1 Like