本文转自:http://blog.csdn.net/lianghyan/article/details/49467207
solr下载: http://lucene.apache.org/solr/downloads.html ( http://www.apache.org/dyn/closer.lua/lucene/solr/5.3.1)
1. 解压缩 solr-5.3.1.zip, 到D:devsolr-5.3.1
2. copy D:devsolr-5.3.1serversolr-webappwebapp的全部内容到 D:devsolrwebapp
3. copy D:devsolr-5.3.1serverlibext的jar包到D:devsolrwebappWEB-INFlib下
4. 创建目录D:devsolrhome, copy D:devsolr-5.3.1serversolr目录下的内容到D:devsolrhome
5. 修改D:devsolrwebappWEB-INFweb.xml
<env-entry> <env-entry-name>solr/home</env-entry-name> <env-entry-value>D:/dev/solrhome</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry> |
6. 修改D:devapache-tomcat-8.0.3confserver.xml, 在host里加入
<Context path="/solr" docBase="D:/dev/solrwebapp" debug="0" crossContext="true"/> |
7. 启动tomcat, 浏览器中输入url:http://localhost:8080/solr
参考: jingyan.baidu.com/article/d8072ac4625b07ec95cefdbe.html
-------------------------------------------------------------------------------------------------------------
8. 在D:devsolrhome目录下, 创建一个目录lyfirstcore, copy D:devsolrhomeconfigsetsasic_configscon到D:devsolrhomelyfirstcoreconf下
9. 在D:devsolrhome目录下, 创建文件core.properties, 并编辑文件
name=lyfirstcore |
10.访问页面http://localhost:8080/solr, 查看core Admin, 'lyfirstcore' 就显示出来了
--------------------------------------------------------------------------------------------------------------------
11. 新建索引
java -classpath D:/dev/solr-5.3.1/dist/solr-core-5.3.1.jar -Dport=8080 -Dauto=yes -Dc=lyfirstcore -Ddata=files -Drecursive=yes org.apache.solr.util.SimplePostTool D:/dev/solr-5.3.1/docs/