Ali
Ali

Reputation: 1225

Content Search, Rebuild Index error

I am new to Sitecore and got a task to build the search using SiteCore 7 API. getting following error on search result query execution.

System.ArgumentNullException: Value cannot be null. Parameter name:
fieldNameTranslator

error raised from following line

IQueryable<SearchResultItem> results = context.GetQueryable<SearchResultItem>();

stack says

Sitecore.ContentSearch.Linq.Solr.SolrIndexParameters..ctor(IIndexValueFormatter valueFormatter, IFieldQueryTranslatorMap`1 fieldQueryTranslators, FieldNameTranslator fieldNameTranslator, IExecutionContext[] executionContexts) +284

I have logged on to content management system and in Index Manager I am trying to rebuild index of sitecore_web_index but I get following error

Job started: Index_Update_IndexName=sitecore_web_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Sitecore.Exceptions.ProviderConfigurationException: Solr operations unavailable. Please check your global.asax,

Upvotes: 5

Views: 4162

Answers (4)

user5051706
user5051706

Reputation: 1

You can get Castle Windsor from NuGet by running this command in Visual Studio:

Install-Package Castle.Windsor -version 3.1.0

You’ll need to set up the IOC container in your global.asax. Edit your application’s global.asax as follows,

<%@Application Language='C#' Inherits="Sitecore.ContentSearch.SolrProvider.CastleWindsorIntegration.WindsorApplication" %>

Now, problem get resolve.

Regrads, Piushpendra

Upvotes: 0

NSP
NSP

Reputation: 121

  • Please make sure that your schema.xml contains, <types></types> node which should hold <filedtype> node as its child. And the <fields></fields> node which should hold <field> node as its child.
  • The schema.xml in Solr example folder might not contains above nodes. once you add above nodes to existing schema.xml then generate the new schema.xml from Sitecore(Control Panel->Indexing).
  • Restart your Solr instance and try to rebuild the Index from Sitecore.
  • Above steps resolve the issue for me. Hope it will help you as well.

Check this for you reference.

Upvotes: 0

NSP
NSP

Reputation: 121

I am also facing the same issue the IOC is also configured on application_start but I dig into the issue further and found that the Sitecore.ContentSearch.ContentSearchManager class hits the Factory.CreateObject("contentSearch/configuration", true); method which returns Sitecore.ContentSearch.SolrProvider.SolrSearchConfiguration object. But the expected object is of ProviderIndexSearchConfiguration. I have used the same Sitecore.ContentSearch.Solr.Indexes.config which is provided in solr configuration package.

and because of that the Initialize method of Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager throwing exception for Operations.

public static void Initialize() { foreach (ISearchIndex searchIndex in SolrContentSearchManager.Indexes) searchIndex.Initialize(); //The searchIndex.Operations is throwing above exception when I put watch on that. }

Upvotes: 0

ishara
ishara

Reputation: 353

  • Check whether you can access Solr from a machine that hosts Sitecore app.
  • Make sure that ContentSearch.Solr.ServiceBaseAddress setting points to a right Solr resource
  • If your solution uses IoC, make sure that there is only one instance of IoC container defined for your application. If needed move container initialization to Application_Start method.

Upvotes: 5

Related Questions