首页 文章

Sitecore Solr索引FieldNameTranslator为null

提问于
浏览
0

我目前正在使用Sitecore索引 - solr和lucene .

我已经制作了自己的自定义索引,它适用于lucene,但我不能让它与Solr一起工作 .

我的问题是每当我使用Solr配置时,FieldNameTranslator对于我的索引都是null .

我使用Sitecore ContentSearch dll以下列方式获取索引:

this.IndexName = indexName;
 this.index = ContentSearchManager.GetIndex(indexName);           
 var i = ContentSearchManager.GetIndex("sitecore_master_index");

作为测试,我也尝试获取sitecore_master_index,这似乎有效 . 我得到以下内容:

enter image description here

我得到一个索引,但每当我通过调用GetQueryable查询它时,它失败并出现以下错误:

异常:System.ArgumentNullException消息:值不能为null . 参数名称:fieldNameTranslator源:Sitecore.ContentSearch.Linq.Solr.SolrIndexParameters..ctor中的Sitecore.ContentSearch.Linq.Solr(在Sitecore上的IIndexValueFormatter valueFormatter,IFieldQueryTranslatorMap1 fieldQueryTranslators,FieldNameTranslator fieldNameTranslator,IExecutionContext [] executionContexts,IFieldMapReaders fieldMap,Boolean convertQueryDatesToUtc) . Sitecore.ContentSearch.SolrProvider.SolrSearchContext.GetQueryable [TItem](IExecutionContext [] executionContexts)中的ContentSearch.SolrProvider.LinqToSolrIndex1..ctor(SolrSearchContext context,IExecutionContext [] executionContexts)

我使用SolrNet作为IOC,从我在文档中可以看到,它应该从8.2及以上工作 . 如果我使用其他IOC之一,那么它的工作正常 .

所以我的问题是这里真的出了什么问题?有人可以向我解释一下FieldNameTranslator是什么以及它是如何在配置中启动的? (我认为它已经设定)

2 回答

  • 1

    我之前遇到过同样的问题,只需将Castle Windsor用于IoC,并将global.asax更改为:

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

    我有同样的问题 . 在您的sitecore访问Solr之前,请确保您的Solr正在运行 . 我刚刚得到完全相同的错误,切换到CasteWindsor并没有帮助你 . 杀死Sitecore WP或执行IISRESET - 然后它可以工作 .

相关问题