solr - 在 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.CollationField 和 solr.ICUCollationField 字段类型类提供此功能,而不是在 <fieldtype ... class="solr.TextField"> 中指定分析器
但是当我将字段类型更改为 solr.ICUCollationField 时,启动时出现以下异常:
Caused by: org.apache.solr.common.SolrException: FieldType: ICUCollationField (text_spell_de) does not support specifying an analyzer
这是如何正确完成的?
解决方案
推荐阅读
- java - 我在哪里放置我的资源文件以使其在 Spring 中使用类路径可读?
- java - 本地开发不能禁用 Spring 配置服务器
- apache - htaccess 错误页面文件不适用于重写条件
- python - Python 2D 数组/列表分配给出了不需要的结果
- facebook - 为什么我无法在 Instagram API 中生成用户令牌?
- python - 在Django中单击like按钮时出错
- react-native - dispatch 不调用reducer React Native
- python - 在 pandas 中用较短的名称替换所有行值
- tensorflow - 超过两个输入的 TF BERT 输入打包器
- go - 如何从 aes 解密中获取二进制数据文件并保存为 tar.gz 存档