Sunday, September 11, 2011

How to filter search results in SharePoint Foundation

I have been working on this for past few days. Actually I wanted to filter all my serach results as i dont want to show people content of my lists. So heres what i did to achieve it -

1. Created a new scope in my site collection.
2. Add rules to the scope to include and exculde content from your site. Here i tried to include all the site pages but excluded the default sharepoint forms like allitems.aspx , etc.

3. Now save this scope.

4. Now it will prompt that the scope will take 14 minutes. You may choose to restart it immediately with Central Administration.
 Go to Central Administration-> Search Service Application-> Search Admin istration and then on "Scopes needing update" click on update now

5. Now go back to your site -open sharepoint designer and create a new page. You may name it as searchresults.aspx. Now  insert a Search Core Result box. Now right click on the webpart and click on webpart properties.

6. Here the trick begin - expand "result query option". Under append the text to query type Scope="QA Portal"  as in my case the name of the scope is QA Portal.


7. Now you can place a search box on any page in your site and link it to the searchresult.aspx page. This will display all your search results.

It worked for me, i hope it will work for you too.

Cheers !!


No comments:

Post a Comment