網頁的標題在檢索排名中佔有很重的權重,但是,一些網站管理系統經常用網站名或欄目名作標題,因此,爲了保證文章的檢索的命中率,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