This blog posting applies to Microsoft Office SharePoint Server 2007.
Microsoft Office SharePoint Server 2007 provides two categories of search scopes: Custom and Contextual.
Issue
Search behaves slightly differently between these categories. Specifically, there are two pages on which search results are displayed, one for each category. The page for Custom scope results is the most familiar: it’s the one that offers custom scopes and properties available via Advanced Search. The page for Contextual scope results is much simpler: there are no best bets, high confidence results, advanced search link nor search tabs. This page is also customizable, but is done at the level of a web designer or farm administrator, not in the same way as the one for Custom scopes, which can usually be customized pretty easily by individual site administrators.
Also, the search results page that can be configured on the Search Settings page affects Custom scope results, and defaults to /SearchCenter/Pages. This setting has no effect on Contextual scope results, which always go to /_layouts/osssearchresults.aspx for MOSS installations (for WSS-only, it is /_layouts/searchresults.aspx).
Impact
When people use the “This Site” or “This List” scope to search, the search engine will perform as it always does, but the results will be shown on a different page and the users may be confused by missing functionality on that page.
“Justification”
The two scope categories are implemented by two different products: contextual scopes are provided by the WSS platform, while custom scopes are provided by the MOSS product running on that platform. This is not an excuse, merely an explanation. It could be argued that it's not so bad for these results pages to differ when someone is searching This Site or This List, because their focus is narrower and they don’t need the advanced results as they do when searching much broader scopes. But users naturally express confusion over why the results are organized differently.
Workaround
Jan Geisbaur commented that he found a pretty simple workaround to redirect to a custom search results page:
1. Create a new aspx through sharepoint designer (named custom-search.aspx)2. Copy code from osssearchresults.aspx to custom-search.aspx, and modify the masterpage in custom-search.aspx3. make a backup of osssearchresults.aspx and replace code with the following javascript: As you can see this takes the parameters from the search box and passes it to custom-search.aspx Remember when you make the special osssearchresults.aspx file, it is unghosted. This means you should create a feature that will install this unghosted file to current site collections, enabling you to deploy it.
As you can see this takes the parameters from the search box and passes it to custom-search.aspx
Remember when you make the special osssearchresults.aspx file, it is unghosted. This means you should create a feature that will install this unghosted file to current site collections, enabling you to deploy it.
Other Options
The following were original ideas for changing this behavior to make it more consistent.
<script language = "javascript">function getURLParam(strParamName){ var strReturn = ""; var strHref = window.location.href; if ( strHref.indexOf("?") > -1 ){ var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase(); var aQueryString = strQueryString.split("&"); for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){ if ( aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){ var aParam = aQueryString[iParam].split("="); strReturn = aParam[1]; break; } } } return unescape(strReturn);}var urlstring = 'http://sharepointURL/_catalogs/masterpage/custom-search.aspx?k=' + getURLParam('k') + '&cs=' + getURLParam('cs') + '&u=' + getURLParam('u')location.replace(urlstring);</script>