Tuesday, April 01, 2008

Add and display Custom Column in SharePoint Search Result

The results in SharePoint Search are displayed by Search Core Results Web Part. This web part have “Selected Columns” property under “Results Query Options” category which contains an XML string that defines all of the columns that are to be displayed in the search results.

The following is the default list of columns shown in the search results:

Now, we will create a new mapped property named “ListItemId”. Managed properties map to one or more of the crawled properties. They group together the related crawled properties and expose them to the user

The Search Settings in the administrative site of the Shared Services Provider has a Metadata Property Mappings link. Clicking on it brings you to the Metadata Property Mappings page

Now, click on “New Managed Property”
Enter, the property name as: “ListItemId” and make sure you select “Integer” and “Allow this property to be used in scopes”
Note: By default “Type of Information “is set to Text

Now, you need map to the crawled properties. The Add Mapping button pops up a dialog box where you can navigate through all of the crawled properties and select the ones you want to map to the managed property
Enter ows_id and press Find, select the property and click OK.

Note: If you didn’t selected “Type of Information “as Integer, SharePoint is not able to search this property.
Now, start a full Crawl of your content and you should now see your List Item in search results