根据官方的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日