【问题标题】:Error installing Solr with Sitecore使用 Sitecore 安装 Solr 时出错
【发布时间】:2016-09-03 02:23:27
【问题描述】:

我正在开发一个基于 Sitecore 8.0 rev 构建的新网站。 150223,我正在尝试安装 Solr 6.2.0.0。我主要遵循这里的说明:https://born4joy.wordpress.com/2015/09/03/installation-and-configuration-of-solr-for-sitecore-8/(我是这个过程和 Sitecore 本身的新手)

我已完成说明中的步骤,但出现以下服务器错误。我在谷歌上找不到任何类似的例子。

Server Error in '/' Application.

Field type 'alphaOnlySort' not found

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: SolrNet.Exceptions.SolrNetException: Field type 'alphaOnlySort' not found

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[SolrNetException: Field type 'alphaOnlySort' not found]
   SolrNet.Schema.SolrSchemaParser.Parse(XDocument solrSchemaXml) +1091
   Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() +914
   Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize() +169

[HttpException (0x80004005): Field type 'alphaOnlySort' not found]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +544
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Field type 'alphaOnlySort' not found]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +716

【问题讨论】:

    标签: solr sitecore


    【解决方案1】:

    您似乎缺少 alphaOnlySort 的 fieldType。尝试将以下定义添加到您的 schema.xml 文件

    <fieldType name="alphaOnlySort" class="solr.TextField" sortMissingLast="true" omitNorms="true">
      <analyzer>
        <!-- KeywordTokenizer does no actual tokenizing, so the entire
             input string is preserved as a single token
          -->
        <tokenizer class="solr.KeywordTokenizerFactory" />
        <!-- The LowerCase TokenFilter does what you expect, which can be
             when you want your sorting to be case insensitive
          -->
        <filter class="solr.LowerCaseFilterFactory" />
        <!-- The TrimFilter removes any leading or trailing whitespace -->
        <filter class="solr.TrimFilterFactory" />
        <!-- The PatternReplaceFilter gives you the flexibility to use
             Java Regular expression to replace any sequence of characters
             matching a pattern with an arbitrary replacement string, 
             which may include back references to portions of the original
             string matched by the pattern.
    
             See the Java Regular Expression documentation for more
             information on pattern and replacement string syntax.
    
             http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html
          -->
        <filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z])" replacement="" replace="all" />
      </analyzer>
    </fieldType>
    

    【讨论】:

    • 谢谢!这绝对应该是显而易见的,但以我目前的知识,我不知道它是从哪里丢失的。 (奇怪的是,默认情况下该文件中不包含该文件!)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-25
    • 2021-01-23
    • 1970-01-01
    • 2015-10-08
    相关资源
    最近更新 更多