Windows builds solr5.4.1 Full-text search engine

Source: Internet
Author: User


I. Build a SOLR server

1. Download Solr http://archive.apache.org/dist/lucene/solr/5.4.1/, and unzip

2. Will. The Solr folder under the \solr-5.4.1\example\example-dih directory is copied to the Tomcat root directory

3. Will. The WebApp under the \solr-5.4.1\server\solr-webapp directory is copied to Tomcat\webapp and named Solr

4. Will. All jar packages under the \solr-5.4.1\server\lib\ext directory are copied to the. \apache-tomcat-7.0.67\webapps\solr\web-inf\lib under

5. Will. The Solr-dataimporthandler-5.4.1.jar and Solr-dataimporthandler-extras-5.4.1.jar in the \solr-5.4.1\dist directory are copied to the. \apache-tomcat-7.0.67\webapps\solr\web-inf\lib under

6. Will. The log4j.properties in the \solr-5.4.1\server\resources directory is copied to the. \apache-tomcat-7.0.67\webapps\solr\web-inf\classes under

If there is no classes file, create a

7. Modify ... The Web.xml in the \apache-tomcat-7.0.67\webapps\solr\web-inf catalogue

Locate <env-entry> nodes, delete comments, and modify the following [HTML]  View plain  copy  print? <span style= "White-space:pre" >    </span>  <env-entry>                     <env-entry-name>solr/home</env-entry-name>                                 <!--to the SOLR folder under the Tomcat root directory  -->                   <env-entry-value>e:\apache-tomcat-7.0.67\solr</ env-entry-value>                   <env-entry-type>java.lang.String</env-entry-type>              </env-entry>   &NBSP;&NBSP;&NBSP;&NBsp;      

8. Start Tomcat, visit http://localhost:8080/solr/index.html#/, the following page shows the success


two. Connecting to the database

1.SQL Configuration

Take MySQL For example, need to download Mysql-connector-java-bin.jar to ... The \apache-tomcat-7.0.67\webapps\solr\web-inf\lib directory

http://dev.mysql.com/downloads/file/?id=462849

2. Create a query

into the Solr/home directory, which is the case. The \APACHE-TOMCAT-7.0.67\SOLR directory

Copy db gets collection

To enter. \apache-tomcat-7.0.67\solr\collection directory, edit the Db-data-config.xml file under the Conf folder [HTML]  View plain  copy  print? <dataConfig>       <datasourcedriverdatasourcedriver= " Com.mysql.jdbc.Driver "Url=" Jdbc:mysql://localhost:3306/dubbotest?useunicode=true&characterencoding=utf-8 &zerodatetimebehavior=converttonull "user=" "Root"  password= "123456"  />        <document>           <entity name= " Student " query=" select* from t_student "                    deltaquery= "Select * fromt_student where  last_modified >  ' ${dataimporter.last_index_time} '                                            deltaimportquery= "Select* from t_student where last_modified > ' ${dataimporter.last_index_ Time} ' ">               <field  column= "id" name= "id"  />                                < fieldcolumnfieldcolumn= "name"  name= "name"  />                                 <fieldcolumnfieldcolumn= "Sex"  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.