Enhance Search Function Security for Restricted Content Access

Actually the search function expose restriceted contents to unauthenticated users. if content of site i restricted search engine must be unaccessible for not logged users