Kentico CMS 7.0 Developer's Guide

Defining general index content

Defining general index content

Previous topic Next topic Mail us feedback on this topic!  

Defining general index content

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

General indexes allow searching through any type of objects used within the Kentico CMS system. This includes items you may recognize from various sections of the administration interface, module related objects and more. Specific examples could be web parts, page templates, groups, sites etc.


While editing an index, its content can be specified on the Index tab by defining the following two properties:


Object name - sets the type of objects that should be searched for by the index. The index will store information representing objects in the system of the specified type. When an object is created, removed or has one of its fields modified, the index will automatically be updated to reflect these changes. Since there is a very large amount of object types in the CMS system, it will in most cases be necessary to choose the (more items...) option and use the full dialog to make your selection.

Where condition - allows a custom WHERE clause to be set for the queries used to retrieve data when building the index. This can be used to limit which records should be included.




Once the object type is selected, it is necessary to configure which fields should be included in the index on the Search fields tab. The settings here affect how objects can be searched for.


Using the drop-down lists at the top, you can specify what kind of data should be displayed in search results:


Title field - specifies which field will be used as the title of result items.

Content field - specifies which field will be used for the content extract of result items.

Image field - specifies which field will be used for the image of result items.

Date field - specifies which field will be used for the date and time displayed with result items.


The rows of the main table contain the fields available for the specified type of objects. These fields correspond with the columns of the database table used to store objects of the given type. The following options can be set for individual fields:


Content - if checked, the content of the field will be indexed and searchable the standard way. Otherwise, objects will not be included in the search results even if they contain the searched for expression in this field.

Searchable - if checked, the content of the field will be searchable by entering an expression in format: <field code name>:<searched phrase>. Please refer to the Search syntax topic for more information about field searches.

Tokenized - indicates if the content of the field should be processed by the analyzer when indexing. The general rule is to use this for Content fields and not for Searchable fields.

Custom search name - relevant for Searchable fields. The specified value is used as a substitute for the field code name in the <field code name>:<searched phrase> search expression. If a value is entered, the original code name can't be used.




The configuration of search fields is global for objects of the given type. If there are multiple general indexes for a single object type (i.e. using the same Object name), changing the search field settings for one index will also affect the others.


You can use the Set automatically link to apply the default configuration for the specific object type. Any changes must be confirmed by clicking the OK button below the table.




General indexes and Sites


The content of general indexes is not affected by the selection made on the Sites tab. It only determines on which websites the index will be available for use (through smart search web parts).


If you wish to configure a general index to search only through objects assigned to a specific site, we recommend using the Where condition property on the Index tab.


For example, a general index with the Group Object name and GroupSiteID = 3 set in its Where condition would only index groups created under the site with a SiteID equal to 3.


This approach is of course only possible for site-bound object types.