1、先下载 Apache Solr 1.3 http://apache.etoak.com//lucene/solr/1.4.0/,解压到如 E:\apache-solr。
2、Apache Tomcat 6 相关mysql驱动放到对应tomcat\lib下。
3、solr 安装到 tomcat。修改 E:\apache-tomcat-6.0.18\conf\server.xml,加个 URIEncoding="UTF-8",把 8080 的那一块改为:配置它保证中文编码正确。
-
<Connector port="8080" protocol="HTTP/1.1"
-
connectionTimeout="20000"
-
redirectPort="8443" URIEncoding="UTF-8"/>
4、把下面的内容保存到 E:\apache-tomcat-6.0.18\conf\Catalina\localhost\solr.xml,没有这个目录自行创建。
-
<Context docBase="E:/apache-solr-1.4.0/dist/apache-solr-1.4.0.war" reloadable="true" >
-
<Environment name="solr/home" type="java.lang.String" value="E:/apache-solr-1.4.0/example/solr" override="true" />
- </Context>
5、现在安装好,启动 tomcat,并打开 http://localhost:8080/solr/admin/ 看看界面。
6、简单solr应用 http://www.cnblogs.com/cy163/archive/2009/09/18/1569681.html
7、solr 的操作
删除 solr 中的数据有几种方式:
1)先来看 curl 方式:
-
-
curl http://localhost:8080/solr/update --data-binary "<delete><query>title:abc</query></delete>" -H 'Content-type:text/xml; charset=utf-8'
-
-
-
-
curl http://localhost:8080/solr/update --data-binary "<commit/>" -H 'Content-type:text/xml; charset=utf-8'
curl http://localhost:8080/solr/update --data-binary "<delete><query>title:abc</query></delete>" -H 'Content-type:text/xml; charset=utf-8'
#删除完后,要提交
curl http://localhost:8080/solr/update --data-binary "<commit/>" -H 'Content-type:text/xml; charset=utf-8'
2)、用自带的 post.jar,在 apache-solr-XXX\example\exampledocs 目录下:
-
-
java -Ddata=args -jar post.jar "<delete><id>42</id></delete>"
-
-
-
- java -jar post.jar -help
java -Ddata=args -jar post.jar "<delete><id>42</id></delete>"
#怎么使用 post.jar 查看帮助
java -jar post.jar -help
3) 直接用 url,使用 stream 相关参数:
比如:
http://localhost:8080/solr/update/?stream.body=<delete><id>123</id></delete>&stream.contentType=text/xml;charset=utf-8&commit=true
stream 相关参数还有:stream.file=(服务器本地文件),stream.url 分别指到你的删除文本,这里是直接字符串内容用 stream.body 参数。commit 参数是指提交,提交了才能看到删除效果。
小结:其实,方式1、2原理一样,直接 POST xml 数据过去。方式3就是直接可以告诉服务器从那些地方取删除的 xml 内容。
分享到:
相关推荐
Tomcat和solr安装配置说明,详细记录了Tomcat和solr安装配置
solr 安装与配置
给出了solr的安装配置说明,分单核和多核两部分
Solr安装与配置 完整的solr配置步骤,带截图,说明很清晰。
solr4.1安装配置 IK分词器 solrJ简单操作 solr索引富文本
描述了solr安装与配置,后续将会更新solr的集群配置
在Linux系统上如何搭建了solr搜索服务,同时运用到项目中
solr搜索服务器安装配置--资料备份
详细的tomcat和solr的配置安装过程
Solr安装与配置solr.rar
基于solr5.5.5的安装部署文档,包含solr导入Oracle数据库
windows中Solr的配置和安装:快速安装搭建sorl在windows中
Solr的配置和安装: 1. 创建一个solr的文件夹作为服务器的位置,里面再建两个文件夹一个home文件夹一个server文件夹。 2. home文件夹中存放apache-solr-3.6.0\example\solr中的所有文件,删除data中所有的数据,...
docker配置solr登录密码文件,内含配置密码的文件 、web.xml的文件 ,详情可以去看我的博客,博客地址:https://blog.csdn.net/huyande123/article/details/97110784
NULL 博文链接:https://fuhuijun.iteye.com/blog/2316664
Solr,SolrCloud, Windows, Tomcat, Apache 在Windows操作系统上进行Solr的云安装与配置
solr详细配置教程与solrj的使用
搜索引擎solr环境配置、分词及索引操作