While troubleshooting search related issues, it sometimes requires me to quickly find very specific type of document. I find property based search very handy and useful in such scenarios. As an example, searching for "fileextension:pdf" will return only pdf documents in the result and saves time if i am specifically looking for pdf documents. In another example, say you are looking for installation documents and you know that those documents are word documents. If you simply search for "installation", the search results will bring all types documents and items for installation. This will mostly require you to browse through the pages of results to find the required word documents. Instead, you can search for "fileextension:doc installation" to return only word documents for installation. In SharePoint Search, this type of search involving property is termed as property based search.
Property based search allows the use of managed properties to help refine searches. The basic format is
<ManagedPropertyname>:<Property Value>
Or
<ManagedPropertyname>:<property Value> <Search keyword>
These forms of search queries will return only those results where the specified property name is equal to the specified property value.
The property based restriction can also be applied to a search scope by creating a scope rule.
There can be many more such properties and their possible values based on the managed properties created and the content crawled respectively. However, I would like to present two commonly used properties and some of their possible values.
ContentType
Some of the possible values for content types are:
Announcement
application/msword
application/pdf
application/vnd.ms-word.document.12
application/x-zip-compressed
Article Page
Categories
Discussion
Document
Event
image/svg+xml
image/tiff
Item
Link
Message
message/rfc822
Page
Post
Sites
Tabs
text/html
text/html: charset=utf-8
Given these possible values for contenttype, if you simply search for contenttype:application/pdf, it will return only the pdf files in the search results or if you search for contenttype:post, it will return only the blog posts from the site collection. Similarly, you could create a scope with a rule which says contenttype is equal to Announcement so that the scope will return only announcements in search.
ContentClass
Some of the possible values for content class are:
STS_Document
STS_List_300
STS_List_850
STS_List_Announcements
STS_List_Categories
STS_List_Comments
STS_List_Contacts
STS_List_DiscussionBoard
STS_List_DocumentLibrary
STS_List_Events
STS_List_GenericList
STS_list_Links
STS_List_PictureLibrary
STS_List_Posts
STS_List_Tasks
STS_ListItem_300
STS_ListItem_850
STS_ListItem_Announcements
STS_ListItem_Categories
STS_ListItem_Comments
STS_ListItem_Contacts
STS_ListItem_DiscussionBoard
STS_ListItem_DocumentLibrary
STS_ListItem_Events
STS_ListItem_GenericList
STS_ListItem_Links
STS_ListItem_Posts
STS_Site
STS_Web
Given these possible values for contentclass, if you simply search for contentclass:sts_web, it will return all the sites in the given search scope or if you search for contentclass:sts_list_post, it will return all the blog posts from the site collection. Similarly, you could create a scope with a rule which says contentclass is equal to sts_listitem_Announcements so that the scope will return only announcements in search.
Del.icio.us |
Digg It |
Technorati |
Blinklist |
Furl |
reddit |
DotNetKicks
Every time users make search using the "this site" scope in the top level search box of the root site, the result page is OSSSearchResults.aspx although you have a search center configured for the site collection.
Well this is a known limitation where you are always redirected to osssearchresults.aspx instead of the configured search center.
In order to redirect the search to the preferred search center, you need to edit the Osssearchresults.aspx page. The Osssearchresults.aspx file is located on the web front-end server, in the following folder by default \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS. Insert the code provided below before the “</script>” tag.
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 strReturn;
}
var urlstring = '/SearchCenter/Pages/results.aspx?k=' + getURLParam('k') + '&cs=' + getURLParam('cs') + '&u=' + getURLParam('u');
location.replace(urlstring);
Del.icio.us |
Digg It |
Technorati |
Blinklist |
Furl |
reddit |
DotNetKicks