我在 jboss 上运行 solr 4.3.1 作为 7.1.1。我正在尝试索引一个简单的 xml 文件
<add>
<doc>
<field name="fname">test1</field>
<field name="number">1</field>
</doc>
</add>
此文件是 test.xml,位于 C:\solr-input\test.xml
这是我的 data-config.xml
<dataConfig>
<dataSource type="FileDataSource" encoding="UTF-8" />
<document>
<entity name="page" processor="XPathEntityProcessor" stream="true" forEach="/doc" url="C:\solr-input\test.xml" transformer="RegexTransformer,DateFormatTransformer">
<field column="name" xpath="/add/doc/field[@name='fname']" indexed="true" />
<field column="number" xpath="/add/doc/field[@name='number']" indexed="true" />
</entity>
</document>
</dataConfig>
它位于 jboss/standalone/deployments/solr/collection1/conf 文件夹中
最后,这是我附加到 solrconfig.xml 的代码
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
所以,当我运行 url
<http://localhost:8080/solr/dataimport?command=full-import>
它说我
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">19</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Total Requests made to DataSource">0</str>
<str name="Total Rows Fetched">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Full Dump Started">2013-06-21 12:25:03</str>
<str name="">
Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.
</str>
<str name="Committed">2013-06-21 12:25:04</str>
<str name="Total Documents Processed">0</str>
<str name="Time taken">0:0:0.148</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>
如果我去
<http://localhost:8080/solr/collection1/select?q=test1&wt=xml&indent=true>
它没有显示任何结果...
我究竟做错了什么?