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.测试:

 

posted @   QiaoZhi  阅读(238)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示