Solr search engine stand-alone configuration

Solr configuration document:
Environment build:
Environment: JDK1.7 tomcat7
1. Download solr4.8
http://pan.baidu.com/share/link?shareid=3786908199&uk=1529561194&fid=615821264240406
2. Create a solr file in the root directory of the F drive 3. Create a solrhome folder
in the root directory of the F drive, copy all files under F:\solr\solr-4.8.1\example\solr to the solrhome folder
4. Copy F:\ solr-4.8.1\example\solr Copy solr-4.8.1.war under solr\solr-4.8.1\dist to webapps of tomcat7 and change its name to solr.war
5. In F:\solr\apache-tomcat-7.0.53\conf\Catalina\ Create a new solr.xml under localhost, the content of the file is as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Context docBase="F:\solr\apache-tomcat-7.0.53 \webapps\solr.war" debug="0" crossContext="true" > 
<Environment name="solr/home" type="java.lang.String" value="F:  \solr\solrhome" override="true" /> 
</Context>
6. Finally, copy the lib under F:\solr\solr-4.8.1\example\lib\ext to F:\solr\apache-tomcat-7.0.53\webapps\solr\WEB-INF\lib and restart tomcat
7. Visit http://localhost:8080/solr to

configure the index:

modify the schema.xml file F:\solr\solrhome\collection1\conf
to add the fields you need,
such as <field name="shopcode" type="text_ik" indexed="true" stored="true" multiValued="false" />
Name: Field name
Type: Type data type
Indexed: Whether to be indexed.
Stored: whether to save
multiValued: whether to allow multiple values, if data.

You can operate the index on the solr management platform, or use the solrj client to operate the index. The main code is as follows, and the operation needs to be submitted.





Add a word segmentation tool: use the commonly used IK word segmentation tool
1.ik-analyzer download address: http://code.google. com/p/ik-analyzer/downloads/list
2. Copy IKAnalyzer2012FF_u1.jar to solr\WEB-INF\lib of solr service.
3. Copy IKAnalyzer.cfg.xml and stopword.dic to the conf of the core where the tokenizer needs to be used, and to the same directory as the schema.xml file of the core.
4. Configure fieldType
 
    <fieldType name="text_ik" class="solr.TextField">  
         <analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>  
</fieldType> 
5. Verify in the management interface as shown in the figure below Correct

reference
Download address: http://mirrors.hust.edu.cn/apache/lucene/solr/5.5.0/
solrj java client: http://www.cnblogs.com/HD/p/3990801.html
solr4 .8 Deployment: http://blog.csdn.net/zwx19921215/article/details/43019231
Development Guide: http://wenku.baidu.com/view/53bba5baeefdc8d377ee322b.html Tokenizer
configuration address: http://blog. csdn.net/clj198606061111/article/details/21289897
solr cluster: http://my.oschina.net/004/blog/227526 http://blog.csdn.




Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327014619&siteId=291194637