SharePoint Setup

Please reference Emmanuel Desigaud's article on how to set up SPS for search. Basically, you need to set up a Content Index and add a Content Source. Also, make sure users performing searches in your CMS site have access to the SPS Search web service.

Installation

Copy SPSSearch.xml to your XML directory if you have one, or any location in your web site. If you like to include additional columns in your search results, add the additional fields to the select statement. You can also change the maximum number of search results returned in <Count>500</Count>, if so desired.

Copy user control SearchInput to your user controls directory. The default search button is a text button. If you like an image button instead, change the Visible attribute of SearchButton and SearchImageButton accordingly and update the ImageUrl of the SearchImageButton. Do not delete either button even if you are not using both.

Copy user control SearchResults to your user controls directory. If you have added additional fields in SPSSearch.xml, customize SearchResult.ascx to include those fields.

You may need to qualify some namespaces in SearchInput.ascx, SearchInput.ascx.vb, SearchResults.ascx and SearchResults.ascx.vb with your project name.

<appSettings><addkey="QuestechSystems.SPSSearchUrl"value="http://<SPSServer>/_vti_bin/search.asmx"/><addkey="QuestechSystems.SPSSearchXml"value="/<CMS Site Application Name>/Xml/SPSSearch.xml"/><addkey="QuestechSystems.SPSSearchIndexesText"value="All,Sub Site 1,Sub Site 2"/><addkey="QuestechSystems.SPSSearchIndexesValue"value="All,Sub_Site_1_Content_Index,Sub_Site_2_Content_Index"/></appSettings>

A drop down list for the Content Indexes specified will be added in the SearchInput user control. The "All" in SPSSearchIndexesValue is a special value that defines search to be performed on all Content Indexes defined in SPSSearchIndexesValue. If you only have one Content Index to search, add the following instead:

Add user control SearchInput to your CMS site to where you want the search input box to show. The results page URL is specified via the SearchResultsUrl property. The search results page can be a CMS template page or a regular ASP.NET page. For example:

If SearchResultsUrl is not specified, the current page will be used for the results page. If you have specified multiple Content Indexes, you can select the default Content Index to search, using the DefaultSearchIndex property. Customize SearchInput.ascx to change the layout of the search input elements.

Add user control SearchResult to your search results page. The control has two properties you can set:

DefaultPageSize: The number of search results per page. Default is 10.

FilterRights: [True|False]. By default, the search results will filter out any CMS page that you don't have access to see. If your search results do not contain any authorized content and/or if you would like to improve performance, set it to False. Use it with caution though.

Include Search.css to all pages that reference the search controls.

Include all new files to your CMS project. Rebuild your site in VS.NET.

Notes

If SearchResults encounters any errors, it will mask the errors and return "No pages were found". To see the actual errors, add querystring "debug=true" to the search results page and reload the page.

The search controls run in CMS Unpublished mode. The links returned in the search results are all published links, however.

Hi Stephen, thanks for this control my cms search is now working. Somebody from my organization asked if we could add a best bets feature to this search. Is this something that's feasible? I know SPS has this feature , but can I use it for CMS search?

I just migrated a bunch of documents from our old SPS 2001 sites to the new SPS 2003 sites and for some reason the search results include documents that have the matching keyword, even when I set the control to search only Non_Portal_Content. Is there a way to fix this?

Would this work on sps2003? I can't access Emmanuel Desigaud's article, so I don't have any doc regarding the SPS. I get error messages when I try to access his site. Could you direct/send me something on how to do the sps config?

Also, do I need to install SPS on the same machine as the MCMS? My set-up is that I have them housed on different machines.

This works on SPS 2003, not 2001. Basically you need to set up a Content Index and a Content Source. Go to Site Settings and click Configure Search and Indexing or consult the SPS Administrator's Guide. And no, the SPS can be a different machine than CMS.

On the Page Properties there is a Description field that I can populate and this description would then be crawled and displayed when the page comes up in my search results? I populated the description field and yet the urn:schemas.microsoft.com:fulltextqueryinfo:description displays the navigational links at the page headers.

Hi, i'm triying to retrive the resume of the posting using thes components, i don't know hao to do it. I have change the .xml file and include the property urn:schemas.microsoft.com:fulltextqueryinfo:content but doesn't work. Can anybody help me. Thank you very much.