Solr 查看有关 post.jar 的帮助

如果希望查看更多有关 post.jar, 小工具的使用,请使用 -help 选项。

运行的命令:java -jar post.jar -help服务器输出:[code]D:\Dkits\solr\example\exampledocs>java -jar post.jar -help
SimplePostTool version 1.5
Usage: java [SystemProperties] -jar post.jar [-h|-] [<file|folder|url|arg> [<file|folder|url|arg>…]]

Supported System Properties and their defaults:
-Ddata=files|web|args|stdin (default=files)
-Dtype= (default=application/xml)
-Durl= (default=http://localhost:8983/solr/update)
-Dauto=yes|no (default=no)
-Drecursive=yes|no| (default=0)
-Ddelay= (default=0 for files, 10 for web)
-Dfiletypes=[,,…] (default=xml,json,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,h
tml,txt,log)
-Dparams=“=[&=…]” (values must be URL-encoded)
-Dcommit=yes|no (default=yes)
-Doptimize=yes|no (default=no)
-Dout=yes|no (default=no)

This is a simple command line tool for POSTing raw data to a Solr
port. Data can be read from files specified as commandline args,
URLs specified as args, as raw commandline arg strings or via STDIN.
Examples:
java -jar post.jar *.xml
java -Ddata=args -jar post.jar ‘42’
java -Ddata=stdin -jar post.jar < hd.xml
java -Ddata=web -jar post.jar http://example.com/
java -Dtype=text/csv -jar post.jar *.csv
java -Dtype=application/json -jar post.jar *.json
java -Durl=http://localhost:8983/solr/update/extract -Dparams=literal.id=a -Dtype=application/pdf -jar post.jar a.pdf
java -Dauto -jar post.jar *
java -Dauto -Drecursive -jar post.jar afolder
java -Dauto -Dfiletypes=ppt,html -jar post.jar afolder
The options controlled by System Properties include the Solr
URL to POST to, the Content-Type of the data, whether a commit
or optimize should be executed, and whether the response should
be written to STDOUT. If auto=yes the tool will try to set type
and url automatically from file name. When posting rich documents
the file name will be propagated as “resource.name” and also used
as “literal.id”. You may override these or any other request parameter
through the -Dparams property. To do a commit only, use “-” as argument.
The web mode is a simple crawler following links within domain, default delay=10s.

D:\Dkits\solr\example\exampledocs>[/code]