akyou56 发表于 2015-7-16 13:32:19

Solr DIH Quick Start

  Step 1 : Edit your solrconfig.xml to add the request handler






   
data-config.xml
   


Step 2 : Create a data-config.xml file as follows and save it to the conf dir










  如果上面 的url参数写错,如写成jdbc:mysql://127.0.0.1:8080/dbname
  可以看到如下信息:
  信息: Creating a connection for entity first with URL: jdbc:mysql://127.0.0.1:8080/dbname
  正确的值应当等于下图中host的值:

  Step 3 : Ensure that your solr schema (schema.xml) has the fields 'id', 'name', 'desc'. Change the appropriate details in the data-config.xml
  
Step 4: 把下面组件放到/lib 目录
mysql-connector-java-5.1.19-bin.jar
apache-solr-dataimporthandler-extras-3.5.0.jar

Step 5 : Run the command http://localhost:8983/solr/dataimport?command=full-import



  
...
    1
    2
    0
...

  
  Step 6: 验证
  http://localhost:8983/solr/select/?q=terrya&version=2.2&start=0&rows=10&indent=on





SD453
terrya


  
页: [1]
查看完整版本: Solr DIH Quick Start