Reputation: 1225
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
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
Reputation: 121
<types></types>
node which should hold <filedtype>
node as its child. And the <fields></fields>
node which should hold <field>
node as its child.Check this for you reference.
Upvotes: 0
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
Reputation: 353
ContentSearch.Solr.ServiceBaseAddress
setting points to a right Solr resourceApplication_Start
method.Upvotes: 5