提交示例数据到索引库

在搜索之前,需要把数据先索引到索引库中,solr 解压开的文件夹里有 example/exampledocs 这个目录,这个目录中存放在示例的文件。启动 solr 服务后,打开命令行,定位到  example/exampledocs 这里假设 solr 解压在D盘根目录下

cd D:\apache-solr-3.4.0\example\exampledocs</p>
<p>java -Ddata=files -jar post.jar *.xml

这样就将 solr 示例数据通过 post.jar 这个工具提交到本地的 solr 服务中,这时在命令行窗口可以看到如下字眼

<br />
SimplePostTool: version 1.2<br />
SimplePostTool: WARNING: Make sure your XML documents are encoded in UTF-<br />
8, other encodings are not currently supported<br />
SimplePostTool: POSTing files to http://localhost:8983/solr/update..<br />
SimplePostTool: POSTing file hd.xml<br />
SimplePostTool: POSTing file ipod_other.xml<br />
SimplePostTool: POSTing file ipod_video.xml<br />
SimplePostTool: POSTing file mem.xml<br />
SimplePostTool: POSTing file monitor.xml<br />
SimplePostTool: POSTing file monitor2.xml<br />
SimplePostTool: POSTing file mp500.xml<br />
SimplePostTool: POSTing file sd500.xml<br />
SimplePostTool: POSTing file solr.xml<br />
SimplePostTool: POSTing file spellchecker.xml<br />
SimplePostTool: POSTing file utf8-example.xml<br />
SimplePostTool: POSTing file vidcard.xml<br />
SimplePostTool: COMMITting Solr index changes..<br />

通过

<br />
java -jar post.jar -help<br />

可以查看到更多关于 post.jar 的使用方法

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress · 闽ICP备18020075号