Kentico CMS 6.0 Tutorial  

Search page

Search page

Previous topic Next topic Mail us feedback on this topic!  

Search page

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

Kentico CMS allows you to perform index-based searching through all documents in the Kentico CMS repository. For this to work, you need to have a search index created. Go to Site Manager -> Administration -> Smart search and choose to create a NewIndex New index. In the following dialog, enter the following details:

 

Display name: My website

Code name: MyWebSite

Index type: Documents

Analyzer type: Standard

Stop words: Default

Assign index to website MyWebSite: enabled

 

Click OK. You will be redirected to the index's editing interface. Switch to the Index tab and click Add allowed content (View). In the following dialog, enter /% into the Path field and click OK. Switch to the Sites tab and make sure that the index is assigned to My website. Switch to the Cultures tab and choose the default culture of your site (typically English - United States).

 

Finally, switch to the General tab and Rebuild (RebuildIndex) the index. Once the index gets rebuilt, the documents on the site are prepared to be searched.

 

 

 

Searching through uploaded text files

 

It is possible to configure the CMS to search the text inside uploaded files, such as PDF, DOC or XLS documents. The configuration is described in Developer's Guide -> Installation and deployment -> Additional configuration tasks -> Configuration of full-text search in files. It's not necessary to configure it at this moment since we will only use the document content search.

 

Now we need to create the search page. Return to CMS Desk, select the root, click New and choose to create a new Page (menu item). Enter Search as the page name and choose the General/Search page template. Click Save Save.

 

Click the Down arrow in the main toolbar until you move the Search page to the end of the list.

 

tutorial_clip0134

 

Switch to the Design tab, choose to Configure (Configure) the SearchDialogWithResults web part and choose the previously created index in its Indexes property. Click OK.

 

Now switch to the live site and view the page. Enter PC into the Search for box and click Search.

 

tutorial_clip0135

 

When you click a search result, you will be redirected to the appropriate document.

 

 

 

Modifying the search results format

 

If you prefer a different design of the search results, you can modify the format by editing the Site Manager -> Development -> Document types -> Root -> Transformations -> SmartSearchResults (or SmartSearchResultsWithImages) transformation.