I recently added google custom search (CSE) as an advanced search on a clients store. While the standard search engine provided decent results it does a very poor job of eliminating useless words (the, a…). Since Goolge does an awesome job of providing relevant search results and the CSE is free we jumped on board.
To get Google CSE implemented check out a great article on Dosh Dosh that is very detailed. This is in fact where I started.
My first hurdle with implementation was that the site content was not indexed by google and no sitemap was generated either. Off I trucked to Godaddy’s admin panel and used their admin features to create a new sitemap.
Google CSE provides a mechanism for submitting a new sitemap for search indexing. Under the Google CSE control panel select ‘indexing’ and use the ‘On-demand indexing’ option near the bottom of the page. Point it at your new sitemap and you’re off to the races. Once your sitemap is submitted your site will be crawled in a few days.
Once your content is indexed you can actually test your search engine (testing instructions included in the Dosh Dosh article.)
The biggest problem I ran into while trying to get this working at my job was getting the width to fit inside my design. We are a non-profit organization and as such are eligible to use Google CSE without displaying any adds, which is were my problem really comes from.
With the Google CSE you are limited to a minimum size of 500px if you choose to display adds on the top and bottom and 795px if you display adds on the side of the search results. As I was not displaying adds I didn’t think that this would have any bearing on my implementation of it. Boy was I wrong.
If you need to get the results down to the minimum width of 500px you need to adjust two places in the code.
First off is in the form submission end of the process. The variable ‘forid’ needs to be changed to 11. ‘Forid’ is the variable that desinates where the adds will be placed. As I stated earlier, we were not displaying any adds so I didn’t even think about changing this. Also there is no clear documentation that this variable exists in the submission form portion of the Google CSE.
Once you have your variable changed (this is also possible when setting the form up by choosing to display adds on the top and bottom) you can go to the page you designated for results and change the actual frame width.
Remember with the adds being displayed on the top and bottom your minimum width is 500px.