Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

Sitecore search: Lucene indexes

Modified: 2009/11/25 14:31 by jim - Categorized as: ASP.NET, Csharp, Search, Sitecore
For our website Evident.nl we use Sitecore CMS. Almost native to Sitecore is the Lucene search engine. Standard back-end search is implemented when you do a fresh sitecore install.

If you want to use Lucene to unlock content for search, and you want to exclude 'content' from your indexes, you need to create a seperate index for your website.

How to: Web config changes: Locate the <database id="web"> key. Add an index key to <indexes> <index path="indexes⁄index[@id='notherIndex']"⁄>

Then, add the actual index definition to the web config file: You can define templates that need to be included in the search index, and you can add fields to the index. Make sure to add the last two types, otherwise rich text fields are not included in the index.

To read about c# code behind implementation of search results from this index, read this article To get a nifty Lucene index viewer for the sitecore backend, read this

<index id="notherIndex" singleInstance="true" type="Sitecore.Data.Indexing.Index, Sitecore.Kernel">

<param desc="name"<$(id<⁄param>

<templates hint="list:AddTemplate">

<!–– The template of the items you want to include in the search ––>

<template>{D755E3F5–A019–4DDF–A8DE–C9E8A9635915}<⁄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">@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>

<⁄fields>

<⁄index>

 © Evident Interactive BV