【发布时间】: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中评论了其他字段。
这些测试没有人起作用。
【问题讨论】: