首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

solr装配配置

2012-12-19 
solr安装配置1、先下载 Apache Solr 1.3 http://apache.etoak.com//lucene/solr/1.4.0/,解压到如 E:\apache

solr安装配置

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 的那一块改为:配置它保证中文编码正确。

    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>"#怎么使用 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 内容。

热点排行