我是 Sitecore 的新手,接到一项使用 SiteCore 7 API 构建搜索的任务。在执行搜索结果查询时出现以下错误。
System.ArgumentNullException: Value cannot be null. Parameter name:
fieldNameTranslator
下一行引发的错误
IQueryable<SearchResultItem> results = context.GetQueryable<SearchResultItem>();
堆栈说
Sitecore.ContentSearch.Linq.Solr.SolrIndexParameters..ctor(IIndexValueFormatter valueFormatter, IFieldQueryTranslatorMap`1 fieldQueryTranslators, FieldNameTranslator fieldNameTranslator, IExecutionContext[] executionContexts) +284
我已经登录到内容管理系统并在索引管理器中尝试重建 sitecore_web_index 的索引,但出现以下错误
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,
最佳答案
- 检查您是否可以从托管 Sitecore 应用程序的计算机访问 Solr。
- 确保
ContentSearch.Solr.ServiceBaseAddress
设置指向正确的 Solr 资源 - 如果您的解决方案使用 IoC,请确保只为您的应用程序定义了一个 IoC 容器实例。如果需要,将容器初始化移动到
Application_Start
方法。
关于c# - 内容搜索、重建索引错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23533308/