添加数据到 Solr 索引文件中

你可以在你本地的 Solr 安装环境下进行测试,下面的命令将会把将所有的 XML 数据添加到 Solr 索引文件中:$ java -Durl=http://localhost:8983/solr/update -jar post.jar *.xml SimplePostTool: version 1.2 SimplePostTool: WARNING: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported SimplePostTool: POSTing files to http://10.211.55.8:8983/solr/update.. SimplePostTool: POSTing file hd.xml SimplePostTool: POSTing file ipod_other.xml SimplePostTool: POSTing file ipod_video.xml SimplePostTool: POSTing file mem.xml SimplePostTool: POSTing file monitor.xml SimplePostTool: POSTing file monitor2.xml SimplePostTool: POSTing file mp500.xml SimplePostTool: POSTing file sd500.xml SimplePostTool: POSTing file solr.xml SimplePostTool: POSTing file spellchecker.xml SimplePostTool: POSTing file utf8-example.xml SimplePostTool: POSTing file vidcard.xml SimplePostTool: COMMITting Solr index changes.. Time spent: 0:00:00.633 $通过执行上面的命令,Solr 已经索引好了数据了。是不是很简单呀。