It is not possible to set GoogleCSE as default search engine of a site

Comments

php5engineer’s picture

Easy way to do this is to replace line 1094 modules/search/search.module

$form_state['redirect'] = 'search/node/'. trim($form_state['values'][$form_id]);

to

$form_state['redirect'] = 'search/google/'. trim($form_state['values'][$form_id]);
rsharkey’s picture

Title: Set as default search engine feature » Fair warning.

Augmenting the core search module is not a very good idea. These changes will have to be remade if you ever update your core Drupal modules.

Instead, it would be best to create a custom module to alter the search form redirect. This way your code can live on even if you do a core Drupal update.

I have posted my source code for such a custom module in this thread here: http://drupal.org/node/391926#comment-6831472

If anyone needs any assistance, I would be happy to help.

dww’s picture

Title: Fair warning. » Set as default search engine feature
Version: 6.x-1.2 » 7.x-1.x-dev
Category: feature » support
Status: Active » Closed (works as designed)

Yes it's possible. I just did it on a D7 site and it's working fine.

Restoring the title so the issue makes more sense.