2017-05-03 49 views
0

我正在尝试在使用Apache Nutch 1.13和Solr 4.10.4进行爬网运行期间提取webgraph结构。Nutch 1.13索引链接配置

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

我已经在Solr中相应地更改了我的集合(通过schema.xml中的各个字段并重新启动Solr),并调整了solr-mapping文件,但无济于事。 由此产生的错误可以在下面看到。

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不工作,但我不需要它们)。

回答

1

您必须指定在solrindex-mapping.xml领域这样

<field dest="inlinks" source="inlinks"/> 
<field dest="outlinks" source="outlinks"/> 

之后,请务必卸载重装集合,包括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"/> 

最好的问候,祝你好运!

+0

啊,谢谢你的提示!我不认为实际上有必要重新加载收藏...愚蠢的我,感谢提示! – dennlinger