How to alter search query to include custom fields?
For the normal Drupal search you can do so by defining a custom search type in a module.

Use hook_search_info() to define your custom search type &amp; hook_search_execute($keys = NULL, $conditions = NULL) to create or extend your search query.

More available hooks can be found at the Drupal's Search interface or by looking up the search contrib module under yourdrupal\modules\search\search.api.php