Solr - 正则表达式为不区分大小写的术语完成字段创建字段
在 solr 社区中,建议对过滤器/方面值进行不区分大小写的术语补全(同时保留方面中的原始大小写)的最佳方法是以“lowercasevalue|OriginalCaseValue”形式索引内容,以便前缀可以匹配第一部分,显示的值可以是 OriginalCase 值。
我想通过利用 fieldType 在任何字段上实现此目的,该 fieldType 将通过 solr.PatternRepaceFilters 构造值。我将如何编写一个模式替换过滤器,将索引为 myfield:MyValue 的字段将“MyValue”转换为“myvalue|MyValue”。但是术语在 myfield_tc:myvalue|MyValue 上完成/分面?
<fieldType name="termCompleteField" class="solr.StrField">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.PatternReplaceFilterFactory" ????????? />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
</analyzer>
</fieldType>
In the solr community it is suggested that the best approach to do case insensitive term completion (while retaining original case in facet) on filter/facet values is to index the content in the form "lowercasevalue|OriginalCaseValue" such that the prefixing can match on the first part while the displayed value can be the OriginalCase value.
I would like to attain this on any field by utilizing a fieldType that would construct the value via solr.PatternRepaceFilters. how would I write a pattern replace filter that would turn "MyValue" into "myvalue|MyValue" for a field being indexed as myfield:MyValue. But term completed/faceted on myfield_tc:myvalue|MyValue?
<fieldType name="termCompleteField" class="solr.StrField">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.PatternReplaceFilterFactory" ????????? />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
</analyzer>
</fieldType>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不
使用
这个新的字段类型替换并添加一个复制字段 termCompleteField_lowercase ?
why don't you replace
with
and add a copyfield termCompleteField_lowercase with this new fieldtype?