Have full-fledged search on your website with Microsoft Search Server
This package uses Microsoft Search Server 2008 Express or Microsoft Search Server 2010 Express to execute keyword searches on your website. Please note that Microsoft Search Server 2008 or 2010 Express must be installed on the web server and configured to index your site - you should consult your C1 hosting provider and ensure that they can provide Microsoft Search Server 2008 Express services. Developers can download Microsoft Search Server 2008 Express or Microsoft Search Server 2010 Express for testing purposes.
Required preparation steps
- Before you set up the Package, you need to install and set up Microsoft Search Server 2008 Express or Microsoft Search Server 2010 Express.
- Make sure to handle the issue of long server names (see Important Note 6).
- We highly recommend that you configure support for the case-sensitive URLs (see Important Note 4).
- If you want the user be able to search within, for example, PDF or DOCX files on your website, you should set up indexing Adobe PDF, Microsoft DOCX and other file types on Microsoft Search Server Express.
- If necessary, you can exclude parts of a page from being indexed by Microsoft Search Server 2008/2010 Express.
How to implement
Once you have configured your Search Server and know the path to the Microsoft Search Server 2008/2010 Express query web service for your site, follow the steps below:
- From the
Content or
Layout perspective, insert the
Composite.Search.MicrosoftSearch
Server.SearchForm function (
Insert >
Function), or add the following code:
<f:function name="Composite.Search.MicrosoftSearchServer.SearchForm" xmlns:f="http://www.composite.net/ns/function/1.0"> <f:param name="SearchButtonLabel" value="OK" /> <f:param name="SearchButtonTitle" value="Search" /> <f:param name="SearchResultPage" value="SearchResultPage.aspx" /> </f:function>
- Specify the
Search Result Pageparameter (required):
- Search Result Page: A page where Composite.Search.MicrosoftSearchServer.SearchResult function will be inserted and the search results will be displayed.
- If necessary, specify its other parameters (optional):
- Search Button Label: The label for the search button. By default this value is set to "OK", but you can change it (Specify a simple value).
- Search Button Title: The label for the search button. By default this value is set to "Search", but you can change it (Specify a simple value).
- From the
Content or
Layout perspective, insert the
Composite.Search.MicrosoftSearch
Server.SearchResult function (
Insert >
Function), or add the following code:
<f:function name="Composite.Search.MicrosoftSearchServer.SearchResults" xmlns:f="http://www.composite.net/ns/function/1.0"> <f:param name="PageSize" value="10" /> <f:param name="SearchServiceUrl" value="http://yourservername/_vti_bin/search.asmx" /> <f:param name="Scope" value="TestScope" /> <f:param name="Credentials"> <f:function name="Composite.Search.MicrosoftSearchServer.GetNetworkCredential"> <f:param name="Username" value="username" /> <f:param name="Password" value="password" /> </f:function> </f:param> </f:function>
- Specify the search service URL:
- Search Service Url: Url to the query service. Example: http://<Your Server Name>/_vti_bin/search.asmx.
Note: Make sure to replace long server names with short ones (see Important Note 6).
- Search Service Url: Url to the query service. Example: http://<Your Server Name>/_vti_bin/search.asmx.
- Specify the
Credentialsparameter if you use the Composite.Search.MicrosoftSearchServer package on a server where Microsoft Search Server is not installed. To use this parameter, select one of the following functions:
- Composite.Search.MicrosoftSearchServer.GetDefaultNetworkCredentials: To use default network credentials.
-
Composite.Search.MicrosoftSearchServer.GetNetworkCredentials: To specify the credentials manually in the following parameters:
- Username: The user in SharePoint 3.0 Central Administration, who has necessary permissions.
- Password: The password of this user.
- If necessary, specify other parmeters (optional):
- Search Query: Keywords to search for (no keywords by default).
- Page Size: Search results per page (10 by default, which you can override by specifying a simple value.)
- Scope: Specify the search scope. If not specified, Composite.Search.MicrosoftSearchServer will be used without the scope.
Note: We recommend that you use set up and use scopes as describes in Creating Search scopes if Microsoft Search Server serves multiple websites.
Excluding page content from indexing
Make sure that RemapperHttpModule is specified in the Web.config on your C1 website. If not, do the following:
- Open the Web.config on your C1 website.
- Add the following configuration under
<httpModules>and<modules>(for IIS 7.0 or later) elements:
<add name="MssRemaper" type="Composite.Search.MicrosoftSearchServer.RemapperHttpModule" />
Now, to exclude a part of a page from being indexed by Microsoft Search Server:
- Open the page in Source Editor.
- Locate the element you want to exclude from indexing.
- Add the
classattribute with the "noindex" value to the element (class="noindex"):
e.g.<div class="noindex"> - Re-index your website.
Tips and Tricks
How to index the entire website without indexing its menu?
Normally, the words in the menu titles on your website get indexed. So if you have a menu title like "Products" and use the menu across the website, the search for "products" will return all the pages where the menu is used.
To avoid this, you can exclude the menu from being indexed as described above. However, in this case, the crawler will not be able to follow the links in the menu, and your site may end up not well indexed.
To handle this, you should have a sitemap page on your website so that the crawler could index the entire website by following the links on your sitemap.
Important Notes
- Before installing this package you should first install and configure Microsoft Search Server 2008 Express or Microsoft Search Server 2010 Express on the server.
- Read documentation on how to index your website.
- To configure the search server to crawl URLs with parameters, use
Search Server > Search Administration > Crawl rulesmenu. - To configure the search server to crawl case-sensitive URLs:
- Microsoft Search Server 2008 Express:
locate and set the value ofCaseSensitiveUrlsto "1" in the following registry key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Applications\GUID\Gather\Portal_Content
(Read more detailed information here.) - Microsoft Search Server 2010 Express:
create a crawl rule that should include all necessary URLs (e.g. "http://*") and enable its Match case option.
- Microsoft Search Server 2008 Express:
- To set up indexing specific file types, such as PDF or DOCX, read detailed information here.
- There is an known issue with long server names when calling the MS Search Server, your
Search Service Urlmust contain the server name only, not the IP or long name. The workaround is to add the record "your_server_ip your_server_name" to theC:\WINDOWS\system32\drivers\etc\hostsfile in your web server.
Customization
You can customize the layout by editing its style sheets:
/Frontend/Composite/Search/MicrosoftSearchServer/Styles.css
Requirements
Composite C1 version 2.0 or later