![]() |
Enterprise Systems »
Content Management Server »
General
Intermediate
License: The Code Project Open License (CPOL)
Microsoft Content Management Server Search ControlsBy Stephen HuenGives Content Management Server web sites search capability using SharePoint Portal Server as the search engine. |
C#, VB, SQL.NET 1.0, .NET 1.1, Win2K, Win2003, ASP.NET, SQL 2000, IIS 5.1, IIS 6, VS.NET2003, DBA, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||

This set of user controls gives Microsoft Content Management Server (MCMS) web sites search capability using SharePoint Portal Server (SPS) as the search engine. It uses SPS' Search web service to provide a simple keyword search. A search option is provided to select specific Content Index. The search results are displayed in a customizable DataGrid.
A C# version of this set of user controls is available here.
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.
<Count>500</Count>, if so desired.
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.
SearchResults to your user controls directory. If you have added additional fields in SPSSearch.xml, customize SearchResult.ascx to include those fields.
appSettings: <appSettings>
<add key="QuestechSystems.SPSSearchUrl"
value="http://<SPSServer>/_vti_bin/search.asmx" />
<add key="QuestechSystems.SPSSearchXml" value="[Url to SPSSearch.xml]" />
<add key="QuestechSystems.SPSSearchIndexesText"
value="[A comma delimited list of Content Indexes Display Name]" />
<add key="QuestechSystems.SPSSearchIndexesValue"
value="[A comma delimited list of Content Indexes]" />
</appSettings>
For example:
<appSettings>
<add key="QuestechSystems.SPSSearchUrl"
value="http://<SPSServer>/_vti_bin/search.asmx" />
<add key="QuestechSystems.SPSSearchXml"
value="/<CMS Site Application Name>/Xml/SPSSearch.xml" />
<add key="QuestechSystems.SPSSearchIndexesText"
value="All,Sub Site 1,Sub Site 2" />
<add key="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:
<appSettings>
<add key="QuestechSystems.SPSSearchUrl"
value="http://<SPSServer>/_vti_bin/search.asmx" />
<add key="QuestechSystems.SPSSearchXml"
value="/<CMS Site Application Name>/Xml/SPSSearch.xml" />
<add key="QuestechSystems.SPSSearchIndexesValue"
value="Site_Content_Index" />
</appSettings>
No drop down list will be added for this case.
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: <%@ Register TagPrefix="uc1"
TagName="SearchInput" Src="~/UserControls/SearchInput.ascx" %>
. . . . . .
<uc1:SearchInput id="SearchInput"
SearchResultsUrl="" DefaultSearchIndex="" runat="server">
</uc1:SearchInput>
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.
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. | You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 27 Jun 2005 Editor: Smitha Vijayan |
Copyright 2004 by Stephen Huen Everything else Copyright © CodeProject, 1999-2009 Web18 | Advertise on the Code Project |