Sitefinity Toolkit Index Providers

Index Providers are classes that facilitate the inclusion of custom data into the built-in Sitefinity Search Engine. By default, only pages, news, and blogs have built-in providers. The custom classes in the Sitefinity Toolkit allow you to bring in the following custom data:
  1. News - Index only current, non-expired news items
  2. Events - Index only upcoming events for the next 2 months
  3. Generic Content - Index all items defined in the Generic Content module.

The following classes need to be implemented for a provider to work.

IndexProvider

Inherits from IIndexingServiceClient, retrieves the actual data to be indexed. In this class you would call the database or wherever the data to be indexed is stored.

IndexerInfo

A wrapper class for the content that converts the data into an indexable object supported by the Sitefinity Search Engine. Parses all MetaData (if present) and adds to the data to be indexed.

SettingsControl

Defines an optional ControlTemplate (UserControl) that would serve as an Editor to allow the user to define options for the search (for example to exclude certain items, or set date ranges). For all current custom IndexProviders, only a basic SettingsControl is implemented, offering no customizations.

ViewControl

Similar to the SettingsControl, this defines a ControlTemplate (UserControl) to show a custom view for the Indexer on the Sitefinity Search Page. For all current custom IndexProviders, only a basic ViewControl is implemented, offering no customizations.

Registering Providers

To use an index provider, register it in the web.config in the node /TELERIK/SEARCH/INDEXCLIENTS node (additional documentation needed).

In addition, a key must be defined in the /APPSETTINGS/ node of web.config for each provider, using the Name of the provider as its key, and the base url to Sitefinity Page that contains the ContentView control.

For example, if the default Events Provider is "Events", and the url that holds the EventsView control is located at /CALENDAR/EVENT.ASPX, you would define the following key in appsettings:

<add key="Events" value="/calendar/event" />

Notice that the value does not include the .aspx extension.

Last edited Feb 28, 2011 at 3:11 PM by SelArom, version 2

Comments

No comments yet.