It’s another one of those things that sounds so simple but ends up being ridiculously unintuitive to configure in SharePoint. I recently embedded a search box web part in a master page and wanted to have it search and return results from a custom list (Business Directory) in my site. So I ran through the usual steps of creating a ‘Business Directory’ display group and search scope for the list. I also set up a custom results page, ran a crawl and then configured the web part to use the Business Directory display group and hide the scope drop down (hidescopeDD). To my dismay I found that when I executed a search query using the web part, results from the entire site where returned rather than results just from my list. My custom results page had the search box web part configured in the same way but with the scope drop down showing (showDD). When I executed the same search in this web part the list results were returned.
So it seems the problem here is that the hidescopeDD DropDownModeEx for the search box hides the scope drop down but it also then defaults to the contextual scope; this:site rather than the only “real” scope in the specified display group. There are only 3 options to hide the drop down and none of these actually specify what the default scope should be (hidescopeDD, HideDD_NoScope, HideDD_useDefaultScope).
So to get around this you can actually specify the scope you want to use in the search box AppQueryTerms attribute.
AppQueryTerms= scope:Business Directory
The AppQueryTerms attribute is quite handy because you can use it as a filter in all sorts of ways. For example you can also specify the content type you want returned:
AppQueryTerms= content type:Business Directory Listing
Or the site you want to results to be returned from: