How to add the Custom Field to the Global Search/Elastic Search in SugarCRM Enterprise 12.0.1

Hello Everyone!
I was wondering if anyone knew how to implement or add a custom field to the global search. I created a custom selection-list in custom/modules/Accounts/clients/base/views/selection-list/selection-list.php, but still not work. Please check my sample code below:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$viewdefs['Accounts']['base']['view']['selection-list'] = array(
'panels' => array(
array(
'name' => 'panel_header',
'label' => 'LBL_PANEL_1',
'fields' => array(
array(
'name' => 'account_number_c',
'link' => true,
'label' => 'LBL_ACCOUNT_NUMBER_C',
'enabled' => true,
'default' => true,
),
array(
'name' => 'name',
'link' => true,
'label' => 'LBL_LIST_ACCOUNT_NAME',
'enabled' => true,
'default' => true,
),
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I  tried also following this documention https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_12.1/Architecture/Global_Search, but still not working. Check my code below:
custom/modules/Accounts/clients/base/views/search-list/search-list.php
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$viewdefs['Accounts']['base']['view']['search-list'] = array(
'panels' => array(
array(
'name' => 'primary', // This is mandatory and the word `primary` can not be changed.
'fields' => array(
array(
'name' => 'picture',
'type' => 'avatar',
'size' => 'medium',
'readonly' => true,
'css_class' => 'pull-left',
),
array(
'name' => 'name',
'type' => 'name',
'link' => true,
'label' => 'LBL_SUBJECT',
),
'account_number_c',
),
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
By the way my custom field is "account_number_c" and I`ve just copied the selection-list.php from Modules folder to Custom Folder.
  • Also, I already set the full_text_search enabled and unified_search to true  in the custom field vardefs. But still I am unabled to search using the custom field value in elastic search.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    <?php
    $dictionary['Account']['fields']['account_number_c'] = array (
    'required' => false,
    'readonly' => false,
    'name' => 'account_number_c',
    'vname' => 'LBL_ACCOUNT_NUMBER_C',
    'type' => 'varchar',
    'massupdate' => true,
    'hidemassupdate' => false,
    'no_default' => false,
    'comments' => '',
    'help' => '',
    'importable' => 'true',
    'duplicate_merge' => 'enabled',
    'duplicate_merge_dom_value' => '1',
    'audited' => true,
    'reportable' => true,
    'unified_search' => true,
    'merge_filter' => 'disabled',
    'pii' => false,
    'default' => '',
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX