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"