1、发送本地文件:
如果是单个文件的话可以直接在浏览器地址栏输入:
http://localhost:[端口号]/solr/[对应的core]/update?stream.file=[文件全路径]
如果是批量的文件,则可以利用curl进行发送:
curl http://localhost:[端口号]/solr/[对应的core]/update?stream.file=[文件全路径]
或者例如
curl http://localhost:8983/solr/mbartists/update -H 'Contenttype:text/xml; charset=utf-8' --data-binary @artists.xml
2、远程发送文件
通过stream.body将文件内容读入到命令行中
curl http://localhost:8983/solr/mbartists/update -F stream.body=@[文件全路径]