Disable drupal default search when use apache solr

In some projects, highly loaded ones, we need to optimize search work. Default drupal search is a bottleneck it takes a lot of resources and give slow responses. Even when apache solr module is installed and properly configured we need to leave default search enabled. It means that on any cron run default drupal search ndex will be rebuilded, it will take disk space and dozens of Mb in data base search_index table. To prevent this we need to execute one update_hook which will disable search index update during cron run and will make empty search_index and other search related tables. Update hook given here. So I wish you good luck! Continue doing drupal!

/**
 * Disable default drupal search.
 */
function yourmodule_updates_update_7001() {
  // Disable default drupal search.
  variable_set('search_cron_limit', 0);
  // Delete unused search data.
  db_delete('search_dataset')->execute();
  db_delete('search_index')->execute();
  db_delete('search_node_links')->execute();
  db_delete('search_total')->execute();
}