How can i solve search issue in civiCRM?
Not sure what you are trying to do exactly, but if you are coding you could use the CiviCRM API to first find the teacher for the student with the API Relationship/Getsingle and then find the data for the teacher with the API Contact/Getsingle?

Aer you familiar with using the CiviCRM API? If not, explanation can be found on the documentation wiki: https://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API