al3xnull
al3xnull

Reputation: 866

How is a custom Sitecore ContentSearch index created?

As the titles states, how is a custom Sitecore ContentSearch index created? I end up with [ConfigurationErrorsException: Index has no configuration.] Sitecore.ContentSearch.LuceneProvider.LuceneIndex.Initialize() +374 each time I try to add in a custom index.

EDIT: Looking for a basic sample standalone configuration. Copying / Pasting sitecore_master_index or sitecore_web_index indexes results in the error.

Upvotes: 1

Views: 2918

Answers (2)

user2404216
user2404216

Reputation: 21

This problem occurs because sitecore_master_index and sitecore_web_index configuration do not contain <Configuration> section.

Add in those indexes definition following node and you should not get this error (*Sitecore.ContentSearch.Lucene.Index.Core.config, Sitecore.ContentSearch.Lucene.Index.Master.config, Sitecore.ContentSearch.Lucene.Index.Web.config*):

<Configuration ref="contentSearch/configuration/defaultIndexConfiguration"/>

I don't know why it is like that, but it looks like Sitecore's provided index samples do not like it when you try to add your own custom index configuration.

Upvotes: 2

Richard Seal
Richard Seal

Reputation: 4266

Have a look at Autohaus on Github. Its a custom Sitecore website built by Alex Shyba and Tim Ward. It has a custom index in there to search all the vehicles so you should be able to follow that and see how its done.

On an overview, they have created a new config and referenced the new index name and created an ISearchIndex object using Sitecore.ContentSearch.ContentSearchManager.GetIndex("index_name");. How are you creating your ISearchIndex object?

Upvotes: 0

Related Questions