Back in the old days, search boxes generally gave you two options: (1) search the whole Web or (2) search only your site. With the advanced query parameters of Bing, you now have complete control to search the subset of the Web you define, and get the results that you are looking for.
Before we dig into the syntax behind each scenario, let me show where to place the query in each of the two search boxes.
<HTML>
<HEAD>
</HEAD>
<BODY>
<form method="get" action="http://search.live.com/results.aspx">
<input type="hidden" name="cp" value="1252">
<input type="hidden" name="FORM" value="FREESS">
<input type="hidden" name="q1" value="PUT_QUERY_HERE">
<table bgcolor="#FFFFFF" cellpadding="0px" cellspacing="0px">
<tr>
<td><input type="text" name="q"></td>
<td><input id="Submit" value="Search" type="submit"></td>
</tr>
</table>
<img style="margin-top:10px" alt="Bing" src="http://search.live.com/s/affillogoLive.gif"></img>
</form>
</BODY>
</html>
<script type="text/javascript" charset="utf-8">
var WLSearchBoxConfiguration=
{
"global":{
"serverDNS":"search.live.com"
},
"appearance":{
"autoHideTopControl":false,
"width":600,
"height":400
},
"scopes":[
{
"type":"web",
"caption":"Demo",
"searchParam":"QUERY_FOR_FIRST_TAB"
}
,
{
"type":"web",
"caption":"Web",
"searchParam":"QUERY_FOR_SECOND_TAB"
}
]
}
</script>
Instead of searching the whole Internet, what if you only wanted to search a part of it? Say, maybe you company has three separate Web sites, and you’d like to search them all. Or perhaps you are interested in a specific topic, and you already know the five best sites for that topic.
To solve this scenario, we can use the site: keyword, which will tell the Bing engine to return only search results from within the specified URLs.
site:microsoft.com
If you would like to specify more than one site, you can do so like this (note that the parentheses are important!):
(site:www.siteone.com OR www.sitetwo.org OR www.sitethree.com/mypage)
Examples:
-
Video search of Comedy Central (sample search terms: “Stephen Colbert”, “John Stewart”, “Rob Corddry”)
(site:www.comedycentral.com OR www.youtube.com OR video.msn.com)
But say that I didn’t want the Daily Show, just the Colbert Report. I can get more specific within the site URL.
(site:www.comedycentral.com/shows/the_colbert_report/ OR www.youtube.com OR video.msn.com)
(site:www.ebay.com OR www.amazon.com OR newegg.com)
(site:msdn.microsoft.com OR msdn2.microsoft.com OR dev.live.com OR www.asp.net OR www.codeplex.com)
You can further refine the query by returning results only of a specific file type by adding the filetype: keyword to the search parameters. Examples of file types could by PDFs, MP3s, or Microsoft PowerPoint files (PPTs).
Example:
-
Search box of tax forms from the IRS (shudder!)
(site:www.irs.gov filetype:pdf)
Using a Predefined Search Macro in a Query
Search macros are a feature of the Bing platform that let people package their own custom queries and share them in the Live Gallery. If you don’t want to write your own custom search, you can leverage the creativity of others by using a predefined macro.
macro:myMacroNamespace.myMacroName
Examples:
-
ASP .NET coding sites (20+)
(macro:nbuggia.codesearch)
-
Search all college Web sites (sample search terms: “admissions”, “financial aid”)
(macro:livesearch.colleges)
You can refine these searches with additional keywords, just like with any other search. Here are a couple of examples.
Examples:
-
Search Spanish versions of all U.S. college Web sites
(macro:livesearch.colleges location:us language:es)
-
Search all ASP .NET coding sites for content in C#
(macro:nbuggia.codesearch prefer:c#)
Searching Your Site’s Neighborhood
A brand-new scenario is the ability to search what is called a Web site’s neighborhood. This is the Web site itself, as well as all of the sites to which the Web site has linked. For example, the neighborhood of Engadget.com would be Engadget itself, along with all of the company Web sites to which it has linked over all those years. The idea behind this feature is that by creating a link on a site you are, in a way, endorsing that site, and your customers might want to get search results from that site. Here’s how to use it.
(LinkFromDomain:yoursite.com OR site:yoursite.com)
We can further expand the definition of a neighborhood to include all of the sites that are linking in, too. This definition is probably more useful for smaller sites that cater to a specific topic, such as medicine.
(LinkFromDomain:mysite.com OR site:mysite.com OR LinkDomain:mysite.com)
One of the great things about this keyword is the Web sites that are searched are dynamic. If a new site becomes popular, chances are that either it is going to link to you or you are going to link to it, and it will automatically show up in the search results.
For reference, here’s a summary of the different keywords and how they can be used. If you would also like to include results from your site, to the end of each of these you’ll need to add:
OR site: mysite.com
|
Sites to which I’m linking
|
LinkFromDomain: mysite.com
|
|
Sites linking to me
|
LinkDomain: mysite.com
|
|
Both
|
LinkDomain: mysite.com OR LinkFromDomain: mysite.com
|
Examples:
-
Extended site search. This will give me results for all of Seth Godin’s blog, as well as all the sites to which he has linked all of these years.
(LinkFromDomain:sethgodin.com OR site:sethgodin.com)
-
Cool smart phones in my country/region. This will give me results from a top cell-phone blog, plus all of the blogs to which they link, and scoped to the U.S.
(LinkFromDomain:coolsmartphone.com OR site:coolsmartphone.com AND loc:US)
-
How influential are you? Type in your own name, or that of someone you know, to see if your favorite blogger or celeb is talking about them (or you!).
(LinkFromDomain:scobleizer.wordpress.com OR site: scobleizer.wordpress.com)
(Linkfromdomain:www.wilwheaton.net OR site:www.wilwheaton.net)
-
Topical search. This will return results from all of the sites to which you link and all of the sites that link to you.
(LinkFromDomain:yoursite.com OR site:yoursite.com OR LinkDomain:yoursite.com OR linkdomain: pinchmysalt.wordpress.com)
Really Advanced Search
Okay, so we’ve covered a couple of scenarios for customizing your search results, and introduced a few keywords and operators. A great resource for experimenting with these tools is the Query Builder on Live.com. You should be able to cut any query that you create with the Query Builder and paste it into the query section of your Windows Bing Box.
Finally, there is a reference on Bing for all of the advanced keywords and operators here. I’ve pulled some of the more interesting ones and listed them in the following table.
|
contains:
|
Restricts results to sites that have links to the file type(s) that you specify. For example, to search for Web sites that contain links to Microsoft Windows Media Audio (wma) files, type music contains:wma.
|
|
filetype:
|
Returns only Web pages that have been created in the file format that you specify. Bing recognizes html, txt, and pdf extensions. Bing also recognizes the extensions for primary Microsoft Office document types, such as doc and rtf for Microsoft Office Word; xls for Microsoft Office Excel; and ppt for Microsoft Office PowerPoint. For example, to find reports created in PDF format, type your subject, followed by filetype:pdf. For example, type information filetype:pdf.
|
|
inanchor:, inbody:, intitle:, inurl:
|
Return pages that contain the specified term in the anchor, body, title, or Web address, respectively, of the site. Specify only one term per keyword. You can string multiple keyword entries, as needed. For example, to find pages that contain “msn” in the anchor and the terms “spaces” and “magog” in the body, type inanchor:msn inbody:spaces inbody:magog.
|
|
language:
|
Returns Web pages for a specific language. Specify the language code directly after the language: keyword. For example, to see only Web pages in English, type "au pair" language:en. You can also access this function by using the Search Builder Language function.
|
|
prefer:
|
Adds emphasis on either a word or another operator. For example, type football prefer:organization.
|
|
feed:
|
Finds RSS or Atom feeds on a Web site. For example, to find RSS or Atom feeds about football, type feed:football.
|