关于solr 5.5 windows script 下无法使用post工具的解决办法

根据官方的docs/quickstart.html中的

NOTE: Currently the bin/post tool does not have a comparable Windows script, but the underlying Java program invoked is available. See the Post Tool, Windows section for details.


Windows support

bin/post exists currently only as a Unix shell script, however it delegates its work to a cross-platform capable Java program.  The SimplePostTool can be run directly in supported environments, including Windows.

SimplePostTool

The bin/post script currently delegates to a standalone Java program called SimplePostTool.  This tool, bundled into a executable JAR, can be run directly using java -jar example/exampledocs/post.jar.  See the help output and take it from there to post files, recurse a website or file system folder, or send direct commands to a Solr server.  

$ java -jar example/exampledocs/post.jar -h
SimplePostTool version 5.0.0
Usage: java [SystemProperties] -jar post.jar [-h|-] [<file|folder|url|arg> [<file|folder|url|arg>...]]
.
.
.

得到了解决办法就是使用java 的 SimplePostTool工具来替代post,但是官方并没有给出具体例子,经过浏览下方外国有人的评论,我找到正确的使用语句。

例子:

d:\solr-5.5.2>java -Dc=gettingstarted -jar example/exampledocs/post.jar .\example\exampledocs\*.xml
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/gettingstarted/update using content-type application/xml...
POSTing file gb18030-example.xml to [base]
POSTing file hd.xml to [base]
POSTing file ipod_other.xml to [base]
POSTing file ipod_video.xml to [base]
POSTing file manufacturers.xml to [base]
POSTing file mem.xml to [base]
POSTing file money.xml to [base]
POSTing file monitor.xml to [base]
POSTing file monitor2.xml to [base]
POSTing file mp500.xml to [base]
POSTing file sd500.xml to [base]
POSTing file solr.xml to [base]
POSTing file utf8-example.xml to [base]
POSTing file vidcard.xml to [base]
14 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/gettingstarted/update...
Time spent: 0:00:06.757

------------------------------------------------

希望对刚接触solr的同学有帮助

smarttk

2016年7月28日

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值