views:

44

answers:

1

I have a sitecore 6.2 site that had no lucene indexes besides the system index. I tried to add this new simple index:

<index id="videoIndex" type="Sitecore.Search.Index, Sitecore.Kernel" >
  <param desc="name">$(id)</param>
  <param desc="folder">IndexFolder</param>
  <Analyzer ref="search/analyzer" />
  <templates hint="list:AddTemplate">
    <template>{854D2F45-3261-45A8-9E52-64D96B5D54E5}</template>
  </templates>
  <fields hint="raw:AddField">
    <field target="category">Categories</field>
    <field target="date">__updated</field>
  </fields>
</index>

Once I add this, browsing to any page on the sitecore site gives the following error:

Could not find add method: AddTemplate (type: Sitecore.Search.Index)

Using lucene 2.3.1.3, .NET 3.5.

+2  A: 

The 'type' attribute of the <index/> element references Sitecore.Search.Index class, which doesn't contain methods like AddTemplate and AddField. It seems you should reference Sitecore.Data.Indexing.Index instead. Take a look at <index id="system" ... /> in web.config.

Hope this helps.

Yan Sklyarenko
I can't say for sure if this would help, as I received an alternate solution from my coworkers. But when I looked further, I saw the "Sitecore.Data.Indexing.Index" reference on the system index (could have sworn I started my index by copying the system index, obviously not), so I will mark this as accepted. Thanks!
Ed Schwehm