Nutch 1.13索引链接配置



我目前正在用Apache Nutch 1.13和Solr 4.10.4。

根据文档,索引链接插件将outlinksinlinks添加到集合中。

我已经在Solr中更改了我的集合(通过schema.xml中的各个字段和重新启动Solr(,并调整了Solr映射文件,但无济于事。结果错误可以在下面看到。

bin/nutch index -D solr.server.url=http://localhost:8983/solr/collection1 crawl/crawldb/ -linkdb crawl/linkdb/ crawl/segments/* -filter -normalize -deleteGone
Segment dir is complete: crawl/segments/20170503114357.
Indexer: starting at 2017-05-03 11:47:02
Indexer: deleting gone documents: true
Indexer: URL filtering: true
Indexer: URL normalizing: true
Active IndexWriters :
SOLRIndexWriter
    solr.server.url : URL of the SOLR instance
    solr.zookeeper.hosts : URL of the Zookeeper quorum
    solr.commit.size : buffer size when sending to SOLR (default 1000)
    solr.mapping.file : name of the mapping file for fields (default solrindex-mapping.xml)
    solr.auth : use authentication (default false)
    solr.auth.username : username for authentication
    solr.auth.password : password for authentication

Indexing 1/1 documents
Deleting 0 documents
Indexing 1/1 documents
Deleting 0 documents
Indexer: java.io.IOException: Job failed!
    at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:865)
    at org.apache.nutch.indexer.IndexingJob.index(IndexingJob.java:147)
    at org.apache.nutch.indexer.IndexingJob.run(IndexingJob.java:230)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.nutch.indexer.IndexingJob.main(IndexingJob.java:239)

有趣的是,我自己的研究导致我假设它实际上是并非平凡的,因为由此产生的解析(无插件(看起来像这样:

bin/nutch indexchecker http://www.my-domain.com/
fetching: http://www.my-domain.com/
robots.txt whitelist not configured.
parsing: http://www.my-domain.com/
contentType: application/xhtml+xml
tstamp :    Wed May 03 11:40:57 CEST 2017
digest :    e549a51553a0fb3385926c76c52e0d79
host :  http://www.my-domain.com/
id :    http://www.my-domain.com/
title : Startseite
url :   http://www.my-domain.com/
content :   bla bla bla bla.

然而,一旦我启用index-links,输出突然看起来像这样:

bin/nutch indexchecker http://www.my-domain.com/
fetching: http://www.my-domain.com/
robots.txt whitelist not configured.
parsing: http://www.my-domain.com/
contentType: application/xhtml+xml
tstamp :    Wed May 03 11:40:57 CEST 2017
outlinks :  http://www.my-domain.com/2-uncategorised/331-links-administratives
outlinks :  http://www.my-domain.com/2-uncategorised/332-links-extern
outlinks :  http://www.my-domain.com/impressum.html
id :    http://www.my-domain.com/
title : Startseite
url :   http://www.my-domain.com/
content :   bla bla bla

显然,这不能适合一个字段,但是我只想有一个带有所有outlinks的列表(我读到inlinks不起作用,但无论如何我都不需要它们(。

>

您必须像

那样指定solrindex-mapping.xml中的字段
<field dest="inlinks" source="inlinks"/>
<field dest="outlinks" source="outlinks"/>

之后,请确保 unload 重新加载该集合,包括Solr的完整重新启动。

您没有指定您在schema.xml中如何确切地实现了字段,但对我而言,以下操作有效:

<!-- fields for index-links plugin -->
<field name="inlinks" type="url" stored="true" indexed="false" multiValued="true"/>
<field name="outlinks" type="url" stored="true" indexed="false" multiValued="true"/>

最好的问候和祝你好运!

最新更新