1. config schema.xml
<fieldtype name="text_ch" class="solr.TextField"> <analyzer type="index"> <tokenizer class="org.lionsoul.jcseg.analyzer.JcsegTokenizerFactory" mode="complex"/> </analyzer> <analyzer type="query"> <tokenizer class="org.lionsoul.jcseg.analyzer.JcsegTokenizerFactory" mode="complex"/> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> </analyzer> </fieldtype>
2. modify synonyms.txt add synonyms what you wanted
电脑,笔记本,苹果
维修,修理,检修
Preferences
http://ju.outofmemory.cn/entry/100831
http://elastos.org/redmine/boards/22/topics/265
本文介绍了如何在Solr中配置文本字段,使用jcseg进行复杂分词,并结合同义词库提高搜索准确性。通过设置分析器和同义词映射,实现更智能的文本检索。
804

被折叠的 条评论
为什么被折叠?



