Using custom ranking for some searches and not others in D7
Search API was built to give a great deal of flexibility to searches. You can create separate search indexes to meet different criteria, weight individual fields differently per index and keep all of your configuration managed in the UI, versus trying to write custom logic into MODULE_ranking().

Download Search API, install and configure your indexes at: /admin/config/search/search_api