${solr.data.dir:C:/solr/collection1/data} 5.如果是Solr4.4版本,则需要手工拷贝相关jar包到服务器相关目录
To get the same logging setup in another container (Tomcat for example) as with the example Jetty server, you need to do the following
1.Copy the jars from solr/example/lib/ext into your container's main lib directory. These jars will set up SLF4J and log4j.
a.Exactly where this lib directory is highly variable. For a Debian or Ubuntu server using the Tomcat package available from the OS vendor, this is likely to be /usr/share/tomcat6/lib or /usr/share/tomcat7/lib.
2.Copy the logging config from solr/example/resources/log4j.properties into a location on the classpath. Usually you can use the same location as the jar files above. Edit the configuration file for your preferred log destination.
3.Optionally, if you did not place log4j.properties on the classpath, set java option -Dlog4j.configuration=file:///path/to/log4j.properties
原文参考:
http://wiki.apache.org/solr/SolrLogging 6.到此,配置solr到Tomcat结束
启动Tomcat后,可以登录solr管理页面:http://localhost:8080/solr/;
如果是Solr4.4以前的版本,在IE中打开后台管理界面是存在一些问题的,需要使用Firefox/Chrome之类的浏览器;在Solr4.4版本中貌似还是没有解决这个问题。
插入数据:
~/solr/example/exampledocs$ java
-Durl=http://localhost:8080/solr/update -jar post.jar
*.xml
查询数据:
通过http://localhost:8080/solr/#/collection1/query直接查询,或者参考上一篇文章。
清除索引: