我对 Solr 很陌生。我成功地通过 DIH 从我的 sql 数据库中索引数据。现在我想导入 xml 文件并通过 DIH 对它们进行索引,但它不起作用!我的 data-config.xml 看起来像这样:
<dataConfig>
<dataSource type="FileDataSource" encoding="UTF-8" />
<document>
<entity name="dir"
processor="FileListEntityProcessor"
baseDir="/bla/test2"
fileName=".*xml"
stream="true"
recursive="false"
rootEntity="false">
<entity name="PubmedArticle"
processor="XPathEntityProcessor"
transformer="RegexTransformer"
stream="true"
forEach="/PubmedArticle"
url="${dir.fileAbsolutePath}">
<field column="journal" xpath="//Name[.='journal']/following-sibling::Value/text()" />
<field column="authors" xpath="//Name[.='authors']/following-sibling::Value/text()" />
..etc
我在 schema.xml 中有以下字段:
<field name="journal" type="text" indexed="true" stored="true" required="true" />
<field name="authors" type="text" indexed="true" stored="true" required="true" />
当我运行 Solr 时,我没有收到任何错误,也没有索引文档:
<str name="Total **Rows Fetched**">**2000**</str>
<str name="Total **Documents Skipped**">**0**</str>
<str name="Full Dump Started">2012-02-01 14:59:17</str>
<str name="">Indexing completed. **Added/Updated: 0 documents.** Deleted 0 documents.
谁能告诉我我做错了什么?!我什至仔细检查了路径语法......