Using Google CSE (with search element layout) with Search Query from Other Page
Today I want to address the awesomeness that is Google Custom Search Engines (CSE). Specifically, I will address how to use the Search Element option paired with a non-google search form that will send the query to the search element. I searched far-and-wide for this solution but in the end came up with my own with a little help from Javascript.
I recently moved a client off of a cheap, hosted search solution to Google CSE in order to cut costs and host the search engine results page (SERP) on their domain. Since Google is their target external search engine for which they measure the success of their organic campaigns on, I thought, ‘OK, CSE sounds like the right fit.’
Step 1: Sign Up and Configure with ‘Search Layout’ Option
First things first, to sign up for your Google CSE. Next, plug in some of the settings such as the domain, the pages to search (you can use powerful regex strings to have CSE index only the content that you want to be indexed). Add any Refinements (Labels) which can help your visitors refine their searches by different sections (I’ll deal with Refinements in a later post). Refinements are very powerful. You will either need to pay a very small fee (or be a registered non-profit or educational institute) in order to have an ad-free SERP.
Now, choose the ‘Look and Feel’ from the left-hand navigation underneath the Control Panel.
Google CSE Control Panel: Look and Feel. Select the ’search element’ optionBoth the iframe and google-hosted page look-and-feel options would give you the code for both the search form and the results page. But, the SERP is limited and doesn’t give you the power and beauty of the custom search element. The drawback of the search element is that the search form and the SERP are included on the same page. It doesn’t give you a method for receiving the query from a global site-search form from any page within the site.
Read more…
This month (February, 2010) marks seven full years of operation. Well, we made it this far.
