Programming4us
         
 
 
Windows

Windows 7 : Using Any Search Engine from the Address Bar

10/17/2010 4:41:15 PM
Searching via the Search box is often easier than visiting the search engine’s site directly, but you’re limited to using either the default search engine or some other search provider that you’ve added to Internet Explorer. But what if you regularly use several search engines, depending on the search text or the results you get? In that case, it’s possible to set up address bar searching for any number of other search engines.

To see how this works, let’s run through an example. Follow these steps to set up address bar searching for Google:

1.
Select Start, type regedit, press Enter, and then enter your UAC credentials. (In Windows XP, select Start, Run, type regedit, and click OK.) The Registry Editor appears.

2.
Navigate to the following key:

HKCU\Software\Microsoft\Internet Explore\SearchURL

3.
Create a new subkey. The name of this subkey will be the text that you enter into the address bar before the search text. For example, if you name this subkey google, you’ll initiate an address bar search by typing googletext, where text is your search text.

Tip

I suggest using subkey names that are as short as possible to minimize typing. For example, I use the name g for my Google key (meaning that I can search by typing gtext into the address bar).

4.
Select the new subkey and double-click its (Default) value for editing.

5.
Type the URL that initiates a search for the search engine, and specify %s as a placeholder for the search text. For Google, the URL looks like this:

http://www.google.com/search?q=%s

6.
You also have to specify the characters or hexadecimal values that Internet Explorer substitutes for characters that have special meaning within a query string: space, pound sign (#), percent (%), ampersand (&), plus (+), equal (=), and question mark (?). To do this, add the following settings to the new subkey. Note that these values work with all search engines.

NameTypeData
<space>REG_SZ+
#REG_SZ%23
%REG_SZ%25
&REG_SZ%26
+REG_SZ%2B
=REG_SZ%3D
?REG_SZ%3F

Figure 1 shows a completed example. The text that you type into the address bar before the search string—that is, the name of the new subkey—is called the search prefix.

Figure 1. A sample search prefix for the Google search engine.


How do you know the proper URL to use for a search engine? Go to the search engine site and run a search with a single word. When the results appear, examine the URL in the address bar, which usually takes the following general form:

ScriptURL?QueryString

Here, ScriptURL is the address of the site’s search script, and QueryString is the data sent to the script. In most cases, you can just copy the URL and substitute %s for your search text when you set up your search prefix. I often experiment with reducing the query string to the minimum necessary for the search to execute properly. For example, a typical Google search might produce a URL such as the following:

http://www.google.com/search?rls=ig&hl=en&q=mcfedries&btnG=Search

In the query string, each item is separated by an ampersand (&), so I delete one item at a time until either the search breaks or I’m down to the search text (q=mcfedries in the earlier query string). To save you some legwork, the following are the minimal search URLs for a number of search sites:

All the Web:

http://www.alltheweb.com/search?query=%s&cat=web

AltaVista:

http://www.altavista.com/web/results?q=%s

AOL Search:

http://search.aol.com/aolcom/search?query=%s

Ask.com:

http://www.ask.com/web?q=%s

Encarta (Dictionary only):

http://encarta.msn.com/encnet/features/dictionary/DictionaryResults.aspx?search=%s

Encarta (General):

http://encarta.msn.com/encnet/refpages/search.aspx?q=%s

Excite:

http://msxml.excite.com/info.xcite/search/web/%s

Live.com:

http://www.live.com/?q=%s

Lycos:

http://search.lycos.com/default.asp?query=%s

Technorati:

http://www.technorati.com/search/%s

Yahoo!:

http://search.yahoo.com/bin/search?p=%s

Other -----------------
- Windows 7 : Understanding Internet Explorer Advanced Options
 
 
Most View
- Windows 7 : Easier Access to Control Panel
- SQL Server 2008 : Developing Custom Managed Database Objects (part 3) - Developing Managed User-Defined Functions
- Parallel Programming with Microsoft .Net : Parallel Loops - The Basics
- Developing Applications for Windows Phone 7 : Data Binding (part 2)
- Windows Azure : Access Control Service - Concepts and Terminology
- Setting Up a Full-Text Index (part 2) - Full-Text Indexing of BLOBs and XML
- Windows7: Troubleshooting Networking from the Command Line (part 2)
- Windows Azure : Access Control Service Usage Scenarios (part 2)
- Windows 7 : Configuring Internet Explorer Security - Enhancing Your Browsing Privacy (part 3) - Enhancing Online Privacy by Managing Cookies
- Security Management in the Cloud - Security Vulnerability, Patch, and Configuration Management (part 1)
Top 10
- Sharepoint 2010 : Enforce Custom Validation on a List or Library
- First Stages of SEO : Assessing Historical Progress
- Windows Server 2008 : Configuring FTP (part 11) - Managing FTP Firewall Options
- Windows Server 2008 : Configuring FTP (part 1) - Installing the FTP Publishing Service
- An OLAP Requirements Example: CompSales International (part 14) - Data Mining
- Windows Server 2008 : Configuring Remote Access (part 3)
- SQL Azure : Security - Access Control
- Windows7: Managing Network Connections (part 2) - Enabling Automatic IP Addressing
- Windows Server 2008 : Adding an Account to the Event Log Readers Group
- DirectX 10 Game Programming : The 2D Resurgence - Sprites