Reputation: 1255
I am deploying my website on CM and CD environment, i am using solr for search i follow all the instructions from Sitecore to configure cm environment from this link :
when i open the cm website, I am getting error says sitecore_web_index
not found :
in above link when i go to Files to enable or disable for Solr section and click on "Excel spreadsheet." they say disable
Sitecore.ContentSearch.Solr.Index.Web.config :
Any idea about this error ? should i keep web index disable on CM?
I am using sitecore 8.1 update 2
I am using this code to retrieve items:
ISearchIndex SitecoreSearchIndex=ContentSearchManager.GetIndex("sitecore_" + Sitecore.Context.Database.Name + "_index");
using (var context = SitecoreSearchIndex.CreateSearchContext())
{
var culture = Sitecore.Context.Language.CultureInfo;
var predicate = PredicateBuilder.True<SearchResultItem>();
predicate = predicate.And(p => p.Paths.Contains(CommonTextFolderId));
predicate = predicate.And(p => p.TemplateId == CommonTextTemplateId);
predicate = predicate.And(p => p.Language == culture.Name);
var items = context.GetQueryable<SearchResultItem>().Where(predicate);
listCommonTexts = items.Select(p => SitecoreContext.Cast<CommonTextModel>(p.GetItem(), false, false)).ToList();
}
Upvotes: 1
Views: 732
Reputation: 27142
When using Solr
, you should never disable sitecore_web_index
on your Content Management server. In fact it's CM server which should rebuild all the indexes.
And on the Content Delivery servers all the indexing strategies should be set to manual - none of the CD servers should rebuild the indexes.
Check this question for explanation what strategy should be used for Solr indexes on both CD and CM servers: Sitecore 8.1 index rebuild strategy for SOLR search provider
Upvotes: 5