Creating an index

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

Information about the content of your site is stored in indexes. You need to have the content of your site indexed in order for it to be searchable using the Smart search module.

 

There are four types of indexes, click the link to learn about how indexes of the type can be configured:

 

Documents index - stores information about the content of documents in your content tree
Forums index - stores information about the content of discussion forums on your site
Custom table index - stores information about data stored in custom tables
User index - stores information about website users

 

The following example shows the general procedure how an index can be created and what options you have when creating it. The procedure is applicable for both document and forum indexes, while differences between the two are noted in the text.

 

1. Go to Site Manager -> Administration -> Smart search and click the New index (NewIndex) link. The New search index dialog will be displayed to you. You will be asked to enter the following details:

 

Display name: name of the index displayed in the administration interface
Code name: name of the index used in website code (the fully qualified file name must be less than 260 characters long, the directory name must be less than 241 characters long)
Analyzer type: type of analyzer that will be used when indexing the content of your site, the following types are available:
Standard - grammar-based analyzer (stop-words, shortcuts, ...), very efficient for English, but may not produce satisfactory results with other languages
Simple - divides text at non-letter characters
Stop - contains a collection of stop-words at which it divides the text
White space - divides text at whitespaces
Keyword - tokenizes the entire stream as a single token; this is useful for data like zip codes, ids, and some product names
Stop words - dictionary containing words which will be omitted from indexing (e.g. 'and', 'or', ...) when a Stop or Standard analyzer is used; the dictionaries are stored in ~\App_Data\CMSModules\SmartSearch\_StopWords
Index type: type of content to be indexed
Documents - indexes content of documents in the content tree
Forums - indexes content of discussion forums
Users - indexes details about system users - fields of the CMS_User system table
Custom tables - indexes records in custom tables
Assign index to site <sitename> - if checked, the index will be assigned to the site whose name is displayed

 

Click OK.

 
devguide_clip1083

 

2. You will be redirected to the index's editing interface. The General tab, which you will be redirected to, shows the same details that you just entered. Notice the info box on the right, which shows general information about the index.

 

The following two action can also be performed on this tab, but it would make no sense to perform them at this stage of creating a new index:

 

Rebuild (RebuildIndex) - deletes the original index and the specified content gets indexed again; the index is automatically optimized after successful rebuild
Optimize (OptimizeIndex) - de-fragments the index, which results in better search performance, particularly in case of large indexes

 
devguide_clip0004

 

3. Switch to the Index tab. This is where you define what content, forums, custom tables or users will be indexed. The content of this tab depends on the type of index that you are creating. Detailed information about defining index content is given in Defining document index content, Defining forums index content, Defining custom tables index content and Defining user index content.

 
devguide_clip0138

 

4. Now switch to the Sites tab. Make sure that the index is assigned to the appropriate website. You may also want to optionally assign the index to some other site in order to have multi-site search results.

 

Click Save.

 
devguide_clip0935

 

5. Switch to the Cultures tab (only available for document indexes). This is where you can choose which cultural versions of the site will be indexed by this index. Choose the cultural version(s) that you want to be indexed. If you have a multi-site index, you can select the cultures separately for each site chosen by the Select site drop-down.

 

Click Save when you have all the cultures selected.
 
devguide_clip0950

 

6. Finally, go back to the General tab and choose to Rebuild (RebuildIndex) the index. This needs to be done only for the first time. Any further changes made to the site will be indexed automatically.

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?smart_search_creating_index.htm