首页 > 解决方案 > 在 solr 7.7 中使用特殊字符进行 Solr 排序

问题描述

我需要在 Solr 7.7 中使用特殊字符(例如德语变音符号)激活排序。当前的字段规范是:

    <fieldType name="text_spell_de" class="solr.TextField" positionIncrementGap="100">
        <analyzer type="index">
            <tokenizer class="solr.StandardTokenizerFactory" />
            <filter class="solr.ManagedStopFilterFactory" managed="de" />
            <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" />
            <filter class="solr.LowerCaseFilterFactory" />
            <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
        </analyzer>
        <analyzer type="query">
            <tokenizer class="solr.StandardTokenizerFactory" />
            <filter class="solr.ManagedSynonymFilterFactory" managed="de" />
            <filter class="solr.ManagedStopFilterFactory" managed="de" />
            <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" />
            <filter class="solr.LowerCaseFilterFactory" />
            <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
        </analyzer>
    </fieldType>

Solr 中的文档说明了排序规则:

solr.Collat​​ionField 和 solr.ICUCollat​​ionField 字段类型类提供此功能,而不是在 <fieldtype ...​ class="solr.TextField"> 中指定分析器

但是当我将字段类型更改为 solr.ICUCollat​​ionField 时,启动时出现以下异常:

    Caused by: org.apache.solr.common.SolrException: FieldType: ICUCollationField (text_spell_de) does not support specifying an analyzer

这是如何正确完成的?

标签: solricu

解决方案


推荐阅读