Community & Support

Cure for broken Google web search?

Issue

I replaced Drupal's built-in search with Google search on several sites. From my Google AdSense account, I created the AdSense for Search code, and plugged into a Drupal block.

For a while, it seemed to work fine. The user selects whether to search on the web or on the site, inputs the search terms, and hits the button. Appropriate results show up on a site page (with said Drupal page also containing code specified by Google, to catch and display the search results).

But not long ago, it stopped working on all my sites. A search on either the web or the site goes to my 404 "not found" page. Heading back to Google for fresh code doesn't fix things.

Solutions?

I looked for solutions in the forums, finding most ideas concentrated in this thread: http://drupal.org/node/78888 . It seems the problem centers around Drupal and Google both using "q=" for conflicting purposes. (Apparently, the use of clean URLs in Drupal doesn't remove that problem.)

Within there, I tried one of the solutions involving changing "q" to "Q" at the .htaccess level. http://drupal.org/node/78888#comment-150786 It apparently works for some, but didn't work for me.

(For any solutions requiring even greater hacking of PHP etc., I'd just as soon give up the Google web search instead – it's not THAT vital. : )

The most promising solution is changing q to as_q in the search parameters. http://drupal.org/node/78888#comment-152368

When I make that change, a search of my site works fine again.

A search on the web, however, now goes to the correct "found" page, but with only this message: "Your search did not match any documents."

Question

Does anyone have Google Search working on Drupal 5.x, with the search code in a block and the results code in a node, per my attempts? If so, did you use the "as_q" mod, or any other trick, to get things working?

Thank you!

Comments

Some notes on a solution

I can't say I've found a great, complete solution, but I've managed workarounds, at least. Detailed notes here: http://www.drupalace.com/blog_entry_fixed_google_web_search_block_2007_0...
--------
A site by, of, and for the Drupal newbie: http://www.drupalace.com

--------

Manuals, Q&A and more for the Drupal beginner

nobody click here