Kentico CMS 7.0 Intranet Administrator's Guide

Search

Search

Previous topic Next topic Mail us feedback on this topic!  

Search

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The portal comes with built-in index-based search functionality. Using it, it is possible to search for text in website content and in the website's discussion forums. The whole functionality is provided by the Smart search module. Full documentation of the module can be found in Developer's Guide -> Modules -> Smart search.

 

Smart search indexes

 

The Smart search module provides indexed-based search using the Lucene search engine. For your website's content to be searchable, the content must be indexed by some of the smart search indexes defined in Site Manger -> Administration -> Smart search. As you can see in the screenshot below, the portal comes with an extensive number of default smart search indexes, so that all its default content is already pre-indexed and fully searchable.

 

There are two basic types of indexes: Documents indexes for content of documents and Forums indexes for content of discussion forums. Primarily, there are two indexes for content of the portal's global section: Intranet Portal - General content and Intranet Portal - General forums. The first one is for content of the global section's documents, while the second one is intended for indexing of the global section's forums. The two indexes are highlighted in the screenshot below.

 

Apart from the global section's indexes, two indexes are also created automatically when a new department or workgroup is created. These indexes are only used for search of the particular department's or workgroup's website section, as described further below. You can identify them by the display name of the department or workgroup present in the name of the index (e.g. Finance - Default and Finance - Forums are indexes of the Finance department).

 

intranetadminguide_clip0155

 

Searching on the live site

 

On the live site, the search functionality is provided by the Smart search box web part. The web part is placed below the main menu on master pages, both the global one and the ones used for department and workgroup sections.

 

intranetadminguide_clip0156

 

Among the web part's properties, the following configuration is the most important:

 

Search button CSS class: CSS class used for the search button next to the textbox. In this case, the SearchButton CSS class ensures that the Search_IPortal icon is used for the purpose.

Search textbox CSS class: CSS class used for the textbox where searched text is entered. The SearchTextBox class is used by default.

Search results page URL: URL of the page where search results should be displayed. The target page must contain either the Search results or the Smart search dialog with results web part with proper configuration in order for search results to be displayed.

Search mode: type of search matching. Determines if a match (search result) should be returned if any word/all words/exact phrase is found in the searched content.

 

As you can see, the actual indexes to be searched are not set in the properties of this web part. Contrary to that, the indexes are selected in properties of the Smart search dialog with results web parts placed on the search results pages where users get redirected after submitting the search request.

 

intranetadminguide_clip0157

 

Search results pages

 

The search result pages are special pages where search results are displayed to users. There are three locations of search result pages:

 

~/Search.aspx - this page displays search results when searching content of the global section.

~/Departments/<department name>/Search.aspx - each department has its own search results page where search results are displayed when searching the department's section.

~/Workgroups/<workgroup name>/Search.aspx - each workgroup has its own search results page where search results are displayed when searching the workgroup's section.

 

intranetadminguide_clip0159     intranetadminguide_clip0160     intranetadminguide_clip0161

 

Global search results

 

The global section's search results are displayed on the ~/Search.aspx page. On this page, the Search dialog with results web part is placed, with its Indexes property configured to IntranetPortal.GeneralContent;IntranetPortal.GeneralForums. This ensures that when a user enters the searched text into the search box anywhere in the global section, they are redirected to the ~/Search.aspx page, where the web part displays search results found in the two indexes.

 

Department and workgroup search results

 

Particular departments and workgroups have their own search results pages. In master pages of the department and workgroup sections, the following values are entered in the Search results page URL property of the Smart search box web part:

 

Departments: ~{%cmscontext.currentdepartment.nodealiaspath%}/Search.aspx

Workgroups: ~/Workgroups/{%communitycontext.currentgroup.groupname%}/Search.aspx

 

This ensures that users are redirected to the correct search results page when searching a department or workgroup. These search results pages also contain the Search dialog with results web parts. The web parts are configured so that in the Indexes property, the following macros are used:

 

Departments: default_department_{%cmscontext.currentdepartment.nodeguid%};forums_department_{%cmscontext.currentdepartment.nodeguid%}

Workgroups: default_group_{%communitycontext.currentgroup.groupguid%};forums_group_{%communitycontext.currentgroup.groupguid%}

 

These macros ensure that correct smart search indexes are selected, depending on the department or workgroup where the search is currently being performed.

 

intranetadminguide_clip0158