However, it turned out to be less obvious how to 'customize' it's behaviour... specifically I wanted the search to search 'sites in Australia' by default. The final result is shown below, and you can try it here
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBx6E3E51MdX08hrn_K8kQgOtXvgCXyO43dxFvhSWKU6irNHuFuyD_jXoJA13LVSxK1PUuiCq9XPz3G03XdlOuPORFVNJbo9JwZFa9IMjJJRk0tvH78z9jyGd5s2LW-bTgC5eh/s400/BingSilverlight.png)
Working with Advanced Queries in the Windows Live Search Box provides some hints about how you can customize the javascript
var WLSearchBoxConfiguration={...}
which controls how the search box works.By default it looks like this
var WLSearchBoxConfiguration=which provides a simple web search. To force the search to be "only for sites from Australia" we needed to add a new
{
"global":{
"serverDNS":"www.bing.com",
"market":"en-AU"
},
"appearance":{
"autoHideTopControl":false,
"width":600,
"height":400,
"theme":"Blue"
},
"scopes":[
{
"type":"web",
"caption":"Web",
"searchParam":""
}
]
}
scope
with a searchParam set:"searchParam":"loc:AU"
Restricting to a specific site/domain is more obvious:
"searchParam": "site:conceptdev.blogspot.com"
It ends up looking like this:
var WLSearchBoxConfiguration=It doesn't look like you need to worry too much about the ASCII-Hex encoding for simple characters (although if you want to encode them, there are plenty of tools).
{
"global":{
"serverDNS":"www.bing.com",
"market":"en-AU"
},
"appearance":{
"autoHideTopControl":false,
"width":600,
"height":400,
"theme":"Blue"
},
"scopes": [
{
"type": "web",
"caption": "this site",
"searchParam": "site:conceptdevelopment.net"
}
,
{
"type": "web",
"caption": "ConceptDev Blog",
"searchParam": "site:conceptdev.blogspot.com"
}
,
{
"type":"web",
"caption":"Web (Australia)",
"searchParam":"loc:AU"
}
,
{
"type":"web",
"caption":"Web (all)",
"searchParam":""
}
]
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.