solr配置中文分词器——(十二)
1.拷贝jar包
2.复制IKanalyzer分析器配置
1.ext.dic
高富帅
黑马程序员
二维表
2.IKAnalyzer.cfg.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>IK Analyzer 扩展配置</comment> <!--用户可以在这里配置自己的扩展字典 --> <entry key="ext_dict">ext.dic;</entry> <!--用户可以在这里配置自己的扩展停止词字典--> <entry key="ext_stopwords">stopword.dic;</entry> </properties>
3.stopword.dic
我
是
用
的
二
维
表
来
a
an
and
are
as
at
be
but
by
for
if
in
into
is
it
no
not
of
on
or
such
that
the
their
then
there
these
they
this
to
was
will
with
3.配置solr-home\collection1\conf\schema.xml
<!-- IKAnalyzer --> <fieldType name="text_ik" class="solr.TextField"> <analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/> </fieldType> <field name="title_ik" type="text_ik" indexed="true" stored="true" required="true" multiValued="false" /> <field name="content_ik" type="text_ik" indexed="true" stored="true" required="true" multiValued="false" />
4.测试:
【当你用心写完每一篇博客之后,你会发现它比你用代码实现功能更有成就感!】
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步