在windows系统中,用curl命令工具索引文件命令:
启动solr
在solr-6.6.0\bin的同级目录下的文件夹ImportData下要索引的文件.
1、索引 json文件
curl "http://localhost:8983/solr/mycore/update?commit=true" --data-binary @../ImportData/books.json -H "Content-type:application/json"
2、索引 csv文件
curl "http://localhost:8983/solr/mycore/update?commit=true" --data-binary @../ImportData/2017-07-07_info.csv -H "Content-type:application/csv"
3、索引 xml文件
curl "http://localhost:8983/solr/mycore/update?commit=true" --data-binary @../ImportData/hd.xml -H "Content-type:application/xml"
用curl貌似不能索引pdf文件
curl "http://localhost:8983/solr/mycore/update?commit=true" --data-binary @../ImportData/solr-word.pdf -H "Content-type:application/pdf"
删除所有数据:curl "http://localhost:8983/solr/mycore/update?stream.body=<delete><query>*:*</query></delete>&commit=true"
删除指定数据:curl "http://localhost:8983/solr/mycore/update?stream.body=<delete><query>id:doc5</query></delete>&commit=true"
来源:https://www.cnblogs.com/shaosks/p/7880495.html