It also needs a change in admin panel - advanced settings - profiles
There's only 2 options : member display name and member brief info.
For what I want it should have been 4 options
Yes, AlexT said it could be done in a mod without modifying core codes.
However, you can do this by changing the core files for now and worry about a mod later. I will give the answer to you; consider it a Winter Solstice Holiday gift.
There are two files you will need to modified. One should not really modify the base template files but for now let's do it that way; later you can create a new template and do your modifications there.
You will need to open BxBaseSearchProfiles.php
find the following line:
'searchFields' => array('NickName', 'Headline', 'DescriptionMe', 'City', 'Tags'),
Change to:
'searchFields' => array('NickName', 'Headline', 'DescriptionMe', 'City', 'Tags', 'FirstName', 'LastName'),
Find:
$sProfileZodiac = ($bExtMode && getParam('zodiac')) ? $GLOBALS['oFunctions']->getProfileZodiac($aProfileInfo['DateOfBirth']) : '';
Below add:
$sProfileFirstName = $aProfileInfo['FirstName'];
$sProfileLastName = $aProfileInfo['LastName'];
Now to add the keys for the template file:
Find:
'nick' => $sProfileNickname,
below add:
'firstname' => $sProfileFirstName,
'lastname' => $sProfileLastName,
Now all you need to do is to add the keys to the template file; search_profiles_ext.html and to the search_profile_sim.html as well if you want to change the simple view.
remember the keys are added using __key_name__ but you can see this when you edit the files.
Use a clean ASCII text editor when editing files.