This page walks you through the creation of your first custom search engine and gives you a tour of the control panel.
This page includes the following sections:
Google Custom Search enables you to create a search engine for your website, your blog, or a collection of websites. You can fine-tune the ranking, customize the look and feel of the search results, and invite your friends or trusted users to help you build your custom search engine. You can even make money from your search engine by using your Google AdSense account.
You can create a search engine that searches only the contents of your website, or you can create one that focuses on a particular topic. You can use your expertise about a subject to tell Custom Search which websites to search, prioritize, or ignore. Because you know your users well, you can tailor the search engine to their interests. Your search engine can take into account the context in which your users are searching. For example, when an avid cyclist searches for "wheel" on Google search, she will have to sift through hundreds of results on automobile tires, steering wheels, or Buddhist wheels. This is because Google search cannot discern that the intended context is "wheels for bicycles." A custom search engine for bicycles, on the other hand, would search only pre-selected websites on bicycles and give relevant results to the cyclist.
Figure 1: Searching for "wheel" on Google search gets results about all kinds of wheels.
Figure 2: Searching for "wheel" on a search engine for bicycles yields more relevant results.
You can create your own custom search engine in a few minutes by filling out a wizard. Once you have defined your search engine, Custom Search generates code for a search box, which you can insert anywhere on your webpage or blog. You can look at Google Picks for examples of popular custom search engines.
A good way to really understand Custom Search is by creating a simple search engine using the wizard. This section tells you how you can define your first search engine, then shows you how the XML code underneath it might look.
Since you're experimenting and figuring out some basic concepts, spend only a couple of minutes making a simple search engine. Don't sweat the details until later. Keep the search engine simple so that you can follow what's happening when you start testing it. You can always change the definitions of the search engine and add more sites and jazzy features later; alternatively, you can delete it altogether and start from scratch.
To create a custom search engine, do the following:
www.google.com/coop/docs/*
.Figure 3: You can try out different queries on your new search engine.
You don't need to understand this yet, but if you want to look under the covers, the two sets of code are the XML code that the wizard has created for you:
<CustomSearchEngine id="_6zdjrkhn3a" creator="001058780666577659641" volunteers="false" keywords="" visible="false" encoding="UTF-8"> <Title>Hello World</Title> <Description>Experimental search engine</Description> <Context> <BackgroundLabels> <Label name="_cse_id" mode="FILTER"/> <Label name="_cse_exclude_id" mode="ELIMINATE"/> </BackgroundLabels> </Context> <LookAndFeel/> <SubscribedLinks/> <AdSense/> <EnterpriseAccount/> </CustomSearchEngine>
<Annotations> <Annotation about="http://www.google.com/coop/docs/*" score="1"> <Label name="_cse_id"/> </Annotation> </Annotations>
The more advanced sections of the developer's guide will walk you through the CSE XML. In the meantime, you can just skim through it. If you are curious about the code for your search engine, you can go to the control panel and click the Advanced tab. The next section tells you about the control panel and all the tabs.
You manage your custom search engines in the My search engines page and define the search engine specifications in the control panel.
You can create more than one search engine under your Google account. The search engines do not have to be related to each other. You can view, manage, and delete them in the My search engines page. You can also do all this through the Custom Search Console Gadget, which is a mini-application that you can add to your iGoogle homepage.
The My search engine page includes the following components:
After you create a custom search engine, you can use the control panel to modify it. You can access the control panel from the My search engines page or your Custom Search Console Gadget.
This section describes the following tabs in the control panel:
The Basics tab let you define public information and general themes about your search engine. The public information is displayed in your custom search engine homepage. The tab has three main sections, Basic Information, Language settings, and Preferences.
Warning: If you want to keep the changes you make in the Basics
tab, click Save Changes before you move on to the next tab; otherwise, you will lose all your modifications.
The Basic information section lets you define the following fields:
The name appears on your custom search engine homepage that Google hosts and the search results page that Google serves.
The description appears on your custom search engine homepage and results page.
When you are in the early stages of defining your search engine, you can skip this setting. Later, when you are fine-tuning results, you can define keywords. For more information, see Changing the Ranking of Your Search Results page.
The Language Settings section lets you define the following fields:
If you select more than one writing system, your users can select the right script from a drop-down list besides the search box.
The Preferences section lets you define the following fields:
Not listing your search engine in the directory does not make it secret or hidden. Just as people can still dial an unlisted phone number, so can web surfers still view your search engine if they know the URL.
The Sites tab lets you tell Google Custom Search which sites to search. A site can be an exact or complete URL for a single page (such as http://www.example.com
) or a URL pattern (such as *.example.com/*
). For more examples of URL patterns, see the Help Center topic on URL patterns.
To include sites in your search engine, click the Include sites link under the Included sites section; to exclude sites from your search engine, click the Exclude sites link under the Excluded sites section. Once you've added at least one site to include in or exclude from your search engine, a menu bar with Add Sites and Delete buttons appear right above your list of sites.
If you have a lot of sites to add, you can add them in bulk by clicking Add Sites, and then clicking the Include sites in bulk link at the top of the dialog box. To remove sites from Custom Search, simply select the check box next to the site and click Delete.
You can list up to 5,000 sites across all your custom search engines.
When you add a site, a dialog box with the following fields appears:
www
in www.example.com
), Custom Search automatically searches all the subdomains of the site. If example.com
has the subdomains, www
, store
, and home
, Custom Search searches for
www.example.com
, store.example.com
, and home.example.com
. So you do not need to add each subdomain.
If you use a URL pattern with wild cards (*), you can skip the next field and just click Save Changes; the control panel automatically selects the correct What to include option for you.
http://code.google.com/apis/
, Custom Search automatically includes every URL that begins with http://code.google.com/apis/
. You do not need to recursively add the URL for subdirectories and subpages. Note: If you want Custom Search to cover just your webpages in a domain and no other domain, do not select this option.
After you select this option, determine how inclusive you want Custom Search be with the linked webpages. The options are:
blog.example.com
, links to http://code.google.com/apis/customsearch/docs/dev_guide.html
, and you select this option, Custom Search includes your site and just the linked page in your search results. It will not include other webpages from code.google.com
or any other page that were not explicitly linked from your site. blog.example.com
links to http://code.google.com/apis/customsearch/docs/dev_guide.html
, and you select this option, Custom Search includes your site, the linked page, and all sibling webpages under the linked page's parent directory (docs/
). If your site links to a URL that ends in a directory (such as code.google.com/apis/customsearch/docs/
) and not an HTML page (such as code.google.com/apis/customsearch/docs/dev_guide.html
), Custom Search searches for all the webpages and subdirectories under that directory. blog.example.com
, links to http://code.google.com/apis/customsearch/docs/dev_guide.html
, and you select this option, Custom Search includes your site, the linked page, and everything under code.google.com
. It will not include webpages from other subdomains, such as groups.google com
or docs.google.com
. You can view twenty sites at a time. If you have a lot of sites, use the URL contains text box to view only URL patterns you want to see. When you are done searching for a specific site, you can click Clear to see all your sites again.
If you have created refinement labels in the Refinements tab, you can apply labels on sites by selecting their check boxes, then selecting the label from the Label actions drop-down list in the menu bar, which is above the list of sites.
The Indexing tab helps you improve the breadth of coverage and freshness of the search results in your custom search engine. If you are satisfied with your search results or if your search engine covers popular sites that you can find on Google search, you don't need to do anything; you can move on to other tabs.
However, if the sites included in your search engine haven't been indexed by Google search, you can make the webpages more discoverable to Google by submitting a Sitemap. A Sitemap is an XML file that lists pages on your website and includes information about your webpages, such as when they were most recently updated, how frequently they change, and how important they are in relation to each other. To learn more about Sitemaps, see Selecting Sites to Search. If you do not want to use Sitemaps, you can add individual URLs of webpages you want Custom Search to index.
Google can index only webpages that can be accessed and crawled. Make sure that you do not have robots.txt file or meta tags that block Googlebot from crawling the pages that you want indexed.
The improvement in the coverage of your index does not happen instantaneously, because it takes some time for the pages to be crawled and indexed. The cycle takes about 24 hours or less. The improved indexing affects only search results within the search engine you create, not your rank and indexing on Google search.
The Indexing tab lets you do the following:
You can request indexing for up to 50 webpages for the search engine. If you had upgraded to Google Site Search, you have higher limits that vary according to your account level. Additional on-demand URLS available tracks the number of webpages you can have Custom Search index for you.
If you have Google Site Search, this tab also includes information about your plan quota and number of pages indexed.
If you have verified that you own the website on Google Webmaster Tools and have a Sitemap, you can enter the the URL of the verified Sitemap in the Sitemap URL text box. A Sitemap helps Google discover additional pages on your site and learn which URLs are more important. Submitting a Sitemap does not guarantee that Google will crawl or index all of your URLs, but Google does use the data in your Sitemap to learn about the structure of your site. To learn more about Sitemaps, see Selecting Sites to Search.
After Google has verified the Sitemap you have submitted, the Indexing tab lists it under the Identified Sitemaps section. To start on-demand indexing, click Index Now. Custom Search starts indexing the 50 most important webpages that haven't already been included in the index. Custom Search determines the importance of the webpages by the priority you have assigned to them in your Sitemap. If the number of webpages with the highest priority exceeds your allotment for on-demand indexing, Custom Search selects the highest priority webpages with the most recent last-modified dates. As Google crawls and indexes your webpages, your custom search engine results might improve.
Note: Sitemaps are submitted to Google search, which means that you cannot have results appear only in your custom search engine but not on Google search.
If you do not want to create and submit a Sitemap or if you are not the owner of the webpages that you want indexed, you can add the URL of webpages to the On-demand indexing using individual URLs list box. After you click Index Now, Custom Search indexes the first 50 pages that have not yet been indexed by Google search.
Refinements are a way for you to categorize sites by topics. For example, if you have a bicycling search engine, you can have categories of, say, bike maintenance, bike reviews, bike stores, biking skills, and so on and so forth. You can create refinement labels that you associate with the sites you listed in the Sites tab. The refinement links appear at the top of your search results page, and users can click them to narrow down their searches. A search page can have as many as 16 refinement links.
To create a refinement label, click Add Refinement, and define the settings. To tag websites with labels, go to the Sites tab, select check boxes next to the sites, and select the label from the Label actions drop-down list. You can tag sites with more than one label.
Before you create your labels, you might want to check out existing labels and pool your resources with Google and other users.
Promotions let you create special results that appear at the top of the results page and define search terms for triggering the results. For example, if you want users who are searching for "cool stuff" to discover your latest widget, you can create a promotion result that would show a link to the webpage about the widget.
You can create a promotion by clicking Add and defining the queries that would trigger the promotion, as well as the content of the special result. The content includes a title, description, image, and the URL of the webpage. The description and the image, which are optional, are not displayed automatically. You must change the setting to activate that feature.
To display the optional description and image in your promotion, do the following:
To create content for the description or add an image, do the following:
To delete promotions, select the checkboxes next to the promotions you want to remove, and click Delete.
To change the appearance—such as the border, text, and background color—of all the promotion results, go the Look and Feel tab, which is described in detail in the Designing the Look and Feel with the Control Panel.
If you want to create a lot of promotions, use the XML format instead, and use this page to upload your XML file. To learn more about the XML format, see the Creating Special Results page.
If you have your own website, you can change the design of your search box and customize the style of the search results page to match the look and feel of your website.
You can select one of the predefined themes that broadly matches the look and feel of your website. If the standard themes are not quite what you want, you can make further changes.
To keep the changes you made, click Save before you move on to the next tab; otherwise, you would lose all your modifications.
For more information, see the Designing the Look and Feel page.
After you specify the look and feel for your search box and search results pages in the Look and feel tab, you can copy the generated code in the Get code tab and insert it in your webpages. Presto, you have an instant custom search engine.
You can make your search social by inviting collaborators to help you tweak your search engine. They can include or exclude sites from your search engine and apply search refinements to them. They cannot change the name, description, and look and feel of your search engine, nor can they access the code and the monetary features in your search engine. You can either invite contributors or accept volunteers who want to collaborate. Your collaborators must have a Google account to contribute to your search engine. If they don't already have one, they can easily create an account.
To invite contributors, simply fill out the Invite others to contribute section and click the Send Invite button. You can have up to 100 contributors.
If your contributors have their own search engines, you can use their refinement labels. You can include relevant sites that they have tagged with labels to your search engine results.
To start contributing, your collaborators can use their Google accounts to log into their My search engines pages. Under the Search engines I'm contributing to section, they can click the control panel for your search engine. The collaborators' control panels are spare and do not have all the fancy features of a full control panel.
Make money with your custom search engine by connecting it to your Google AdSense account. When users click on an ad in your search results, you get a share of the ad revenue.
If you do not have an AdSense account but want one, simply click I am a new AdSense user and fill out the form. After your application is approved, you can see your AdSense ID. You can also create channels to track the monetization performance of your search engines. To learn more about channels, see the Help Center for AdSense.
Warning: If you already have an existing AdSense account, do not create a new one, even if you create multiple search engines. Google automatically associates your search engines with the same AdSense account. Creating another AdSense account might result in the termination of your AdSense account.
If you have an existing AdSense account, click I already have an AdSense account and fill out the form. All the search engines in your account will be associated with your AdSense account.
Google Site Search lets you create search engines that do not include ads, remove Google branding (if you so choose), have access to XML feeds of your search results, and have more control over how the results are presented to your users, among other things. Although you can manage and define your Site Search search engine in the control panel, you have to use the WebSearch Protocol to implement the additional level of customization.
If you want to upgrade to the business edition, click the Convert to Google Site Search button and fill out the form. The business edition starts from $100 a year. The annual fee for various plans are listed in the Google Enterprise page.
When you've outgrown the control panel and want to start tinkering with the advanced features, you should consider using the Custom Search context and annotations files. The context file is in XML format, while the annotations file can be in OPML, TSV, or Custom Search XML format. Don't be intimidated if none of these terms sound familiar to you; the rest of the developer guide discusses them and shows you what you can do with the advanced tools.
When you tweak your search engine, you can test the changes in the Preview tab.
The Statistics tab displays the same dashboard that you can access from the My search engine page. It shows the number of queries processed by your search engine. If enough users are using the same search terms, you will be able to see the most popular queries for your search engine. You can use this data to fine-tune your search engine.
Once you have defined your search engine, your users can access them in four places:
Remember to create your profile to let your users know a bit about you.
If the custom search engine that you just created with the wizard works for your needs, you're all set. But if you want to learn more about the more powerful and advanced features of the Custom Search API, you can continue to The Basics.
Forward to The Basics >