远程流式传输pdf文件到Solr时出错

时间:2014-12-02 07:38:17

标签: apache solr streaming

我正在尝试将远程文件流式传输到Solr,以便使用stream.url参数作为

进行索引
curl 'http://localhost:8983/solr/update/csv?stream.url=http://www.artofproblemsolving.com/Resources/Papers/SatoNT.pdf&stream.contentType=application/pdf;charset=utf-8'

遵循此处的解决方案Remote streaming with Solr。但是,Solr服务器会抛出错误

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">400</int>
<int name="QTime">518</int>
</lst>       
<lst name="error">
<str name="msg">Document is missing mandatory uniqueKey field: id</str><int name="code">400</int>
</lst>
</response>

我尝试查看Solr文档和维基页面,但无法找到一个示例。任何帮助表示赞赏。

更新

这是我的schema.xml文件 - http://pastebin.com/akmruD9N

问题是只有一个字段,即id具有required="true" multiValued="false"属性,并且用作uniqueKey

<uniqueKey>id</uniqueKey>

并且必须将字段设置为uniqueKey否则Solr远程流不起作用。我应该使用哪个字段而不是id

1 个答案:

答案 0 :(得分:1)

您正在尝试将PDF文件发送到旧版CSV导入端点。所以,它做了奇怪的事情和抱怨。

您想使用Extract handler。它涵盖了很多信息,包括给出一个PDF文件示例并明确设置id:

  

卷曲“http://example.com:8983/solr/update/extract?stream.file=/path/to/file/StatesLeftToVisit.doc&stream.contentType=application/msword&literal.id=states.doc

相关问题