Follow this blog:
RSS
Email Alert

Web Designer

Set up a Google Custom Search Engine for your website

Takeaway: There are both free and cheap versions of the Google Custom Search Engine, and it’s easy to set up. Ryan Boudreaux gives you a quick demo.

Most, but not all organizations with a restricted intranet utilize an in-house site search feature that provides employees, members, and outside affiliates with remote access and the ability to search for internal documents, data, and other information from within the private network. Did you know that Google offers customized search that you can add to your website?

The Google Custom Search basic plan is named “Standard Edition” and is free, however, it does include ads which are required on your results pages. The “Site Search” edition starts at $100 per year, includes guaranteed support and greater results customization options, and ads are optional on results pages.

Google Custom Search Engine allows web developers to build a tailored search experience using the core Google search technology, and it allows you to prioritize or restrict search results based on settings that you specify from a control panel. Several features allow you to manage the way your custom search engine responds from within your particular intranet; the control panel gives you the power to manipulate settings that will fine tune the search results your user’s request.

Getting started

First, you will need a Google Account; if you already have the free account you can sign in from there or create a new account. Once your account is established or you have logged in, then you can access the Google Custom Search Management home page. Below are the quick steps to setting up your custom search:

  1. From the Google Custom Search home page click on the option to “New search engine…“.
  2. Next, describe your search engine by adding a name and short description, then select the language preference. Any of these settings can be changed later from the “My Search Engines” page.
  3. Now you can add in the sites you want to include in your custom search, this is where you define your search engine. You can add any site URL, including yours or any that you do not own. Individual page URL’s or entire site URL’s work equally as well, additional URL formatting can include specific wildcard patterns which would only include results for certain parts of the site, for example: www.yoursite/*subdirectoryName*
  4. Select the edition you wish to use; remember, Standard Edition is free but comes with ads on the search results page, and the Site Search Edition starts at $100 per year with ads optional on results pages. With the standard edition you have an option of using Google Ad Sense to monetize from the results pages when you configure the settings with your AdSense for Search Program. Agree to the Terms of Service by checking the box and then click the “Next” button.
  5. You can select the style you want.
  6. In the Try your search engine section, test it out. Don’t like the results? Go back to the previous page and add (or remove) sites.
  7. To get the code to implement Custom Search on your website, you need to click Next. Copy the code and paste it into your website wherever you want your Custom Search Engine to appear.

The screen capture below displays the first page of the Google Custom Search setup for your search engine:

Figure A

Click to view larger images.

Available control panel features

There are several ways to manage your custom site search engine and this includes features which can be added or modified at any time once you make your initial site setup. The list below includes the feature options and a short description of each.

Sites: You can add new sites, sub-sites, or specific pages to increase the scope of your custom search engine. You can add the new sites individually or in bulk, and specify individual pages, entire sites, parts of sites, or entire domains. You can also exclude portions of a site by specifying those directories you want to keep out of the search results.

Indexing: You can set Google to instantly crawl and index new or updated web pages in your search engine.

Refinements: In essence, you will categorize your search results, and help users search by category. Refinements are labels that you can apply to websites in your search engine index to help your users effortlessly find the material they are searching. When a user clicks a refinement label, sites that you have annotated with the label are either searched exclusively or given priority in the results you choose.

Promotions: Allow you to promote your URL by adding a special box to the top of your search results which promote certain URL’s including those that are not in your search engine.

Synonyms: You can expand your users’ search queries by using synonyms, which are variants of a search term.

Auto completions: You can add in auto complete features to save your users time by displaying similar search types as they enter text into the search.

Look and Feel: You can customize the style giving your search engine a look and feel that matches your particular website. You can specify the layout from the search engine control panel.

Monetization: You can associate an AdSense account with your free Custom Search Engine to start placing contextually relevant ads on your search results pages and it shares a portion of the advertising revenue with AdSense partners.

Other feature settings and configurations include:

  • Business Settings, where you can convert a free account to the Google Site Search (fee-based) search
  • Admin Accounts, where you can add users to administer your search engines
  • Audit Logs where you can view change history logs
  • Preview, allows you to test your Custom Search Engine
  • Statistics, allows you to view usage stats for your search engine
  • Get Code, gives you the HTML snippets for your Custom Search Engine

Custom Google Search Engine Demonstration

A quick review of the steps to setting up a Custom Google Search Engine will focus on the specific topic of “permaculture”, which according to Wikipedia is a branch of ecological design, ecological engineering, and environmental design which develops sustainable architecture/human settlements and self-maintained agricultural systems modeled from natural ecosystems. The step-by-step demonstration utilizes screen captures for each of the phases of configuration. I am using public URLs for demonstration purposes, and remember that when you start to define your custom search engine for intranet internal usage, you can include any URLs either public or private.

1.     Start by creating your Search Engine. Enter the name, description, language selection, sites to search, edition selection, and then verify terms of service, and click Next.

Figure B

2.     Customize styles. Includes separate options for text, elements, search controls, search button, refinement tabs, title text colors, snippet text color, normal and hover state styles, promotions text styles, snippet text styles, promotion borders, and background styling. Once the custom styling is selected, select Next.

Figure C

3.     Get the code. Paste the code in the page where you’d like the Custom Search element to appear. Note: For the most cross-browser compatibility, it is recommended that your HTML pages use a supported doctype such as <!DOCTYPE html>. CSS hover effects require a supported doctype.

Figure D

4.     Paste the Custom Search element code into your HTML document file and then test it live from the page, or go back to your Google custom search control panel to manage the search engine; you can run a preview test by just clicking on the search engine in the list you’ve created.

Figure E

The test search window is displayed below:

Figure F

I entered the search term phrase reclaimed water, with the following results:

Figure G

This quick demonstration did not include any of the extra feature settings, which I described above. The purpose of this was to show how quick and easy it is to get started with a Custom Google Search Engine. Once you set up the basics, you can always go back to the control panel and further refine your features and settings.

Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters.

Ryan Boudreaux

About Ryan Boudreaux

Ryan's experience includes a broad range of technology support roles and web development expertise.

Ryan Boudreaux

Ryan Boudreaux
Ryan has performed in a broad range of technology support roles for electric-generation utilities, including nuclear power plants, and for the telecommunications industry. He has worked in web development for the restaurant industry and the Federal government.