Thursday, February 26, 2009

Customize Search - Advanced Search.

This article will explain how to customize MOss2007 Search - Advanced Search page
Add a newly created column in Property Restriction dropdown to customize advanced search.
1. Log in to your SSP site and go into search settings. Go into "Content sources and crawl schedules" and do a full crawl to make sure Share Point’s search knows about your column. We need to do the full crawling after a new column gets added in document library to make is proper indexing.
2. Now go to the search settings and go to "Metadata property mappings" and click on "New managed property". On this page give a unique name to your managed property, choose a data type for it, and map it to one or more "Crawled Properties" by using the "Add Mapping" button down the bottom. Search for your column and click add. Once your done do another full crawl to re-index the metadata as a managed property.




Content type is already defined in managed property in Moss as shown in below screen shot.




3. Now you need to customize the advanced search page to tell it when to allow people to use your new property. Browse to your advanced search page, and under the site actions menu select "edit page". In the "Advanced Search Box" web part, use the edit menu and select "Modify Shared Web Part". In the right hand pane expand the properties category, and look for the Properties XML option. This contains XML that tells Share Point how to display the advanced search. You need to add the following to this XML:



4. Under the node, add a tag like this
Where ="{Managed Property Name} equals the name of the managed property that you created in the SSP, {Data Type} matches the data type you gave the property in the SSP, and {Display Name} is what you want the property to appear as in the drop down menu on the advanced search page





5.In one (or all if you want to) of the nodes add the following node: This will have your property appearing in the drop down for each result type you add it for (by default in result types you have all results, word documents, excel document and presentations, if you want it to appear for all of these searches (and other custom ones) you need to add this tag to each ResultType tag).



In this way a new property can be added in advanced search page property restrictions dropdown.
Result page
Result page after adding a new property Content type in Property restriction dropdown looks like.









































No comments: