添加一个目录里所有内容到solr
root@h102 solr-5.3.0# du -sh docs/
70M docs/
root@h102 solr-5.3.0#
root@h102 solr-5.3.0# bin/post -c gettingstarted docs/
java -classpath /data/solr/solr-5.3.0/dist/solr-core-5.3.0.jar -Dauto=yes -Dc=gettingstarted -Ddata=files -Drecursive=yes org.apache.solr.util.SimplePostTool docs/
SimplePostTool version 5.0.0
Posting files to base url http://localhost:8983/solr/gettingstarted/update...
Entering auto mode. File endings considered are xml,json,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
Entering recursive mode, max depth=999, delay=0s
Indexing directory docs (3 files, depth=0)
...
...
POSTing file DIHProperties.html (text/html) to base/extract
POSTing file RequestInfo.html (text/html) to base/extract
POSTing file ClobTransformer.html (text/html) to base/extract
Indexing directory docs/solr-dataimporthandler/resources (0 files, depth=2)
3773 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/gettingstarted/update...
Time spent: 0:02:41.136
root@h102 solr-5.3.0#
索引XML
root@h102 solr-5.3.0# bin/post -c gettingstarted example/exampledocs/*.xml
java -classpath /data/solr/solr-5.3.0/dist/solr-core-5.3.0.jar -Dauto=yes -Dc=gettingstarted -Ddata=files org.apache.solr.util.SimplePostTool example/exampledocs/gb18030-example.xml example/exampledocs/hd.xml example/exampledocs/ipod_other.xml example/exampledocs/ipod_video.xml example/exampledocs/manufacturers.xml example/exampledocs/mem.xml example/exampledocs/money.xml example/exampledocs/monitor2.xml example/exampledocs/monitor.xml example/exampledocs/mp500.xml example/exampledocs/sd500.xml example/exampledocs/solr.xml example/exampledocs/utf8-example.xml example/exampledocs/vidcard.xml
SimplePostTool version 5.0.0
Posting files to base url http://localhost:8983/solr/gettingstarted/update...
Entering auto mode. File endings considered are xml,json,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
POSTing file gb18030-example.xml (application/xml) to base
POSTing file hd.xml (application/xml) to base
POSTing file ipod_other.xml (application/xml) to base
POSTing file ipod_video.xml (application/xml) to base
POSTing file manufacturers.xml (application/xml) to base
POSTing file mem.xml (application/xml) to base
POSTing file money.xml (application/xml) to base
POSTing file monitor2.xml (application/xml) to base
POSTing file monitor.xml (application/xml) to base
POSTing file mp500.xml (application/xml) to base
POSTing file sd500.xml (application/xml) to base
POSTing file solr.xml (application/xml) to base
POSTing file utf8-example.xml (application/xml) to base
POSTing file vidcard.xml (application/xml) to base
14 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/gettingstarted/update...
Time spent: 0:00:23.754
root@h102 solr-5.3.0#