【问题标题】:Solr DIH XML do not extractingSolr DIH XML 不提取
【发布时间】:2018-04-10 03:53:36
【问题描述】:

我正在尝试使用 Solr 7.0 索引一些 wiki 页面,但在最后一步中,DataImportHandler 显然没有提取数据。我不知道发生了什么,因为没有抛出错误。

当我打电话给http://localhost:8983/solr/mycore/dataimport?command=full-import 时,会发现两种不同的行为。

我的第一个请求的第一个响应是。​​

{
    "responseHeader":{
        "status":0,
        "QTime":75
    },
    "initArgs":[
        "defaults",[
            "config","data-config.xml"
         ]
     ],
    "command":"full-import",
    "status":"idle",
    "importResponse":"",
    "statusMessages":{}
 }

我再次按回车时的第二个响应是。​​

{
    "responseHeader":{
        "status":0,
        "QTime":26
    },
    "initArgs":[
        "defaults",[
            "config","data-config.xml"
        ]
    ],
    "command":"full-import",
    "status":"idle",
    "importResponse":"",
    "statusMessages":{
        "Total Requests made to DataSource":"0",
        "Total Rows Fetched":"2",
        "Total Documents Processed":"0",
        "Total Documents Skipped":"0",
        "Full Dump Started":"2017-10-28 07:05:31",
        "":"Indexing completed. Added/Updated: 0 documents. Deleted 0 
            documents.",
        "Committed":"2017-10-28 07:05:31",
        "Time taken":"0:0:0.449"
    }
}

正如您在第二个答案中看到的那样,DIH 找到了 2 个文档。这正是我在测试文件wiki.xml 中拥有的文档的编号。问题是 DIH 没有像您在 Indexing completed. Added/Updated: 0 documents. Deleted 0 documents. 中注意到的那样进行提取

这是我的 Solr 配置:git gist。我正在使用 Windows 10、Solr 7.0 和 Lucene 7.0。

到目前为止我已经尝试过什么......

  • 我试图提取的数据之一是“用户”,但它存在一些违规行为,例如,<contributor> XML 标签有一段时间有两个子标签<username>(用户昵称)和<id>(用户 id)当用户有帐户时,而在其他时候,当用户没有帐户时,<contributor> 仅与一个子标签 <ip> 一起出现。所以我只是尝试在没有“用户”数据的情况下导入数据。
  • 我只是想只获取 ID 和标题。为此,我在data-config.xml 中评论了其他字段。

这些测试没有人起作用。

【问题讨论】:

    标签: solr lucene


    【解决方案1】:

    你的问题很简单,你的entity标签一开始是关闭的,所以后面的fields标签都被忽略了。

    因此,您需要在之后添加</entity> 标签并将<entity/> 替换为<entity>

    但是,您的 solrconfig.xml 仍然包含错误,您使用的是 ClassicIndexSchemaFactory,但您有 AddSchemaFieldsUpdateProcessorFactory,这将导致异常。您应该将经典模式工厂替换为托管模式工厂,或者只是删除此添加字段更新处理器工厂。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多