xml - Solr DataImportHandler 不适用于 XML 文件

我是 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.

谁能告诉我我做错了什么?!我什至仔细检查了路径语法...

最佳答案

我建议查看类似问题的答案:

Need help indexing XML files into Solr using DataImportHandler

使用像 groovy 这样的脚本语言要简单得多,也更容易测试。

https://stackoverflow.com/questions/9097223/

相关文章:

python - 如何使用 setuptools 和 setup.py 从包中排除单个文件

maven - 使用 build-helper-maven-plugin 和 multi modul

asp.net - 签署网络表格 - 数字签名选项

oracle - 创建实体化 View 比创建表慢得多

math - 执行以下 1 的补码定点整数算术运算

vb.net - 创建后如何释放 MS Access LDB 锁定文件

emacs - 在 emacs(或 DDD)中使用 gdb 时无法设置断点

image-processing - 使用小波和曲波进行特征提取

google-maps - 在 Google Maps Static 上呈现比例尺

ruby-on-rails - 使用设计在 Rails 3.1 和 2.3.12 之间共享 sess