This is the last part of the three part example of Implementing Lucene search with Sitecore CMS. In this section we will add our custom index to the Sitecore web.config.
Adding the custom index to the Sitecore web.config
Locate the system index located in the indexes section of the web.config and add the following index node:
<index id="custom" singleInstance="true" type="Sitecore.Data.Indexing.Index, Sitecore.Kernel">
<param desc="name">$(id)</param>
<templates hint="list:AddTemplate">
<template>{2F76CAF2-2D22-43B9-B1C3-8E0434D02EB9}</template>
<template>{86743DC4-55F3-4BB5-9922-86D65E2D4EA9}</template>
</templates>
<fields hint="raw:AddField">
<field target="created">__created</field>
<field target="updated">__updated</field>
<field target="author">__updated by</field>
<field target="published">__published</field>
<field target="name">@name</field>
<field storage="unstored">@name</field>
<field target="template" storage="keyword">@tid</field>
<field target="id" storage="unstored">@id</field>
<type storage="unstored">memo</type>
<type storage="unstored">text</type>
<type storage="unstored" stripTags="true">html</type>
<type storage="unstored" stripTags="true">rich text</type>
<type storage="unstored" stripTags="true">word document</type>
</fields>
</index>
Note: The templates represent the specific types of Sitecore templates your custom index will be applied to. In our example, this applies to the Home and Generic Page templates.
Locate the databases node of the Sitecore web.config and locate the “web” database and add the following code to the indexes node:
<index path="indexes/index[@id='custom']"/>
Note: Always remember to save a backup of the working Sitecore web.config prior to making changes. Save the new web.config file and rebuild your database index for the web database located in the Sitecore Control Panel.