2014-09-12 114 views
2

我遇到了一個問題,其中通過重定向抓取的初始頁面沒有被抓取或編入索引。Nutch 1.4和Solr 3.6 - Nutch沒有抓取301/302重定向

我有http.redirect.max屬性設置爲5,我已經嘗試值0,1和3

<property> 
    <name>http.redirect.max</name> 
    <value>5</value> 
    <description>The maximum number of redirects the fetcher will follow when 
    trying to fetch a page. If set to negative or 0, fetcher won't immediately 
    follow redirected URLs, instead it will record them for later fetching. 
    </description> 
</property> 

我還試圖清除掉大部分的什麼是在正則表達式-urlfilter.txt和crawl-urlfilter.txt。除了被抓取的網站以外,這是這些文件中唯一的其他參數。

# skip file: ftp: and mailto: urls 
-^(file|ftp|mailto): 

# skip image and other suffixes we can't yet parse 
-\.(gif|GIF|jpg|JPG|png|PNG|ico|ICO|css|sit|eps|wmf|zip|ppt|mpg|xls|gz|rpm|tgz|mov|MOV|exe|jpeg|JPEG|bmp|BMP|PDF|pdf|js|JS|swf|SWF|ashx|css|CSS|wmv|WMV)$ 

此外,它似乎像Nutch是爬行和推動只有查詢字符串參數的頁面。

查看輸出時。

http://example.com/build Version: 7 
Status: 4 (db_redir_temp) 
Fetch time: Fri Sep 12 00:32:33 EDT 2014 
Modified time: Wed Dec 31 19:00:00 EST 1969 
Retries since fetch: 0 
Retry interval: 2700 seconds (0 days) 
Score: 0.04620983 
Signature: null 
Metadata: _pst_: temp_moved(13), lastModified=0: http://example.com/build/ 

有一個默認的IIS重定向發生引發302添加尾部斜槓。我已經確定這個斜槓已經添加到所有頁面上。所以不確定爲什麼這是重定向。

只需要更多的信息,這裏是我嘗試過的一些參數。

depth=5 (tried 1-10) 
threads=30 (tried 1 - 30) 
adddays=7 (tried 0, 7) 
topN=500 (tried 500, 1000) 

回答

0

嘗試在Web服務器上運行Wireshark看到的是被服務到底是什麼,並在機器上的Nutch是看到真實所請求的內容。如果他們在同一臺服務器上,太棒了。嘗試一下並在捕獲之後將HTTP添加到您的過濾器框中。