lucene3.5 solr1.8.5 tomcat6.0

solr:

1.建立solr目录:E:\ProgramData\solr\home,并把apache-solr-3.5.0\example\solr目录下的所有文件复制过来

2.建立solr目录:E:\ProgramData\solr\server\solr,并把E:\Program Files (x86)\tomcats\apache-solr-3.5.0\example\webapps\solr.war复制过来解压

3.把E:\ProgramData\solr\home\conf\solrconfig.xml中<dataDir>${solr.data.dir:}</dataDir>改为<dataDir>${solr.data.dir:E:/ProgramData/solr/home/data}</dataDir>;并把 <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" enable="${solr.velocity.enabled:true}"/>注释

4.把E:\ProgramData\solr\home\data目录清空

5.建立solr目录:E:\ProgramData\solr\home\dic,并把mms4j中的chars.dic,units.dic,words.dic,words-my.dic复制进来

6.在E:\ProgramData\solr\server\solr\WEB-INF\lib目录中,添加mmseg4j-all-1.8.5.jar,mmseg4j-solr-1.8.5.jar

7.在E:\Program Files (x86)\tomcats\apache-tomcat-6.0.29\conf\server.xml中;<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"></Host>里边,添加<Context path="/solr" docBase="E:/ProgramData/solr/server/solr" reloadable="false">
    <Environment name="solr/home" type="java.lang.String" value="E:/ProgramData/solr/home" override="true"/>
   </Context>

8.在mmseg4j的readme中把

<fieldType name="textComplex" class="solr.TextField" >
      <analyzer>
        <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="complex" dicPath="dic"/>
      </analyzer>
    </fieldType>
	<fieldType name="textMaxWord" class="solr.TextField" >
      <analyzer>
        <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="max-word" dicPath="dic"/>
      </analyzer>
    </fieldType>
	<fieldType name="textSimple" class="solr.TextField" >
      <analyzer>
        <tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple" dicPath="n:/OpenSource/apache-solr-1.3.0/example/solr/my_dic"/>
      </analyzer>
    </fieldType>

 复制到E:\ProgramData\solr\home\conf\schema.xml中的types节点下,并改

<tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple" dicPath="n:/OpenSource/apache-solr-1.3.0/example/solr/my_dic"/>

 成<tokenizer class="com.chenlb.mmseg4j.solr.MMSegTokenizerFactory" mode="simple" dicPath="dic"/>

 

8.启动tomcat,访问http://localhost:8080/solr/admin/analysis.jsp

你可能感兴趣的:(lucene3.5)