网页的标题在检索排名中占有很重的权重,但是,一些网站管理系统经常用网站名或栏目名作标题,因此,为了保证文章的检索的命中率,nutch在生成lucene的数据时,把anchor也做为排名因素,给予必定的权重。anchor是该网页在其它网页中连接给的名称,从nutch1.3开始,nutch将采集的数据经过solrindex向solr服务器创建索引。 html
我在使用solrindex向solr服务器创建索引后,发现anchor的数据项是空项,也就是说anchor的数据没有写入到solr的索引文件中。这个问题困扰了我很久。 java
打开nutch1.6的源代码,发现 solrindex有一个选项 -filter,启用 -filter 选项,会执行IndexingFilters类。IndexingFilters.java专门用来处理 nutch-default.xml 或nutch-site.xml定义的index的插件。因此,要想在solr中看到anchor数据,两步能够实现: 服务器
1.在nutch-site.xml的plugin.includes中定义index-anchor 网站
<property> <name>plugin.includes</name> <value>protocol-http|urlfilter-regex|parse-(html|tika|zip|js|swf|msword|mspowerpoint|msexcel|pdf|feed)|index-(basic|anchor|more)|scoring-opic|urlnormalizer-(pass|regex|basic)</value> </property>2. 带 -filter参数执行建索引的命令 ./nutch solrindex 。
nutch的文档太少了,琢磨出来了,写出来,也供碰到一样问题的网友参考。 url