解决nutch搜不到结果

  • 搜索中文出现乱码:修改/etc/tomcat5/server.xml。增加URIEncoding/useBodyEncodingForURI两项。
    <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true"/>  
  • 网页快照中文乱码。修改页面tomcat6/webapps/nutch/cached.jsp,将content = new String(bean.getContent(details))修改为content = new String(bean.getContent(details),"utf-8")。
  • 搜索不到内容。修改/var/lib/tomcat5/webapps/ROOT/WEB-INF/classes/nutch-site.xml为如下内容:
    <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>searcher.dir</name> <value>/tmp/apache-nutch-1.2/crawl-20110507144354</value> </property> </configuration> 
  • 其中crawl-20110507144354是索引文件目录index的上一级目录。

    参考:
    http://hi.baidu.com/swearing/blog/item/e00fcd7e69b2bb340cd7da38.html
    http://adorechen.blog.163.com/blog/static/3889027220092945842934/
    http://vicalloy.wordpress.com/2008/11/15/nutch%E9%83%A8%E7%BD%B2%E5%8F%8A%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%EF%BC%88%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81%E7%AD%89%EF%BC%89%E4%BF%AE%E6%AD%A3/

你可能感兴趣的:(tomcat)