Ed Schwehm
Ed Schwehm

Reputation: 2171

Creating Lucene Index for Sitecore causes "Could not find add method" errors

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.

Upvotes: 0

Views: 3027

Answers (1)

Yan Sklyarenko
Yan Sklyarenko

Reputation: 32270

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.

Upvotes: 3

Related Questions