使用NUTCH进行单站点的爬取与检索测试

单站点的爬取与检索测试

1, 创建urls文件夹,在文件夹下面创建seed.txt
文件, seed.txt文件中输入要爬取的站点例如: www.osu.edu
mkdir -p urls 


cd urls

touch seed.txt to create a text file seed.txt under urls/ with the following content (one URL per line for each site you want Nutchto crawl).

2,修改conf/crawl-urlfilter.txt

MY.DOMAIN.NAME替换为osu.edu

原来为:

# accept hosts in MY.DOMAIN.NAME

+^http://([a-z0-9]*\.)*MY.DOMAIN.NAME/

现在为:

# accept hosts in MY.DOMAIN.NAME

+^http://([a-z0-9]*\.)*osu.edu/

3, 开始爬取

bin/nutch crawl urls -dir crawldemo -depth 2

4, 配置tomcat,并重新启动,重启的过程不能忘记.

gsli@ubuntu:~/Downloads/apache-tomcat-7.0.10/webapps/nutch-1.2/WEB-INF/classes$
cat 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>/home/gsli/Downloads/nutch-1.2/crawldemo</value>

                                      <description></description>

</property>

</configuration>

5, nutch的搜索页面进行检索

需要在完成第四步的配置,然后重启tomcat才可以进行检索



 



转载于:https://www.cnblogs.com/afreethinker/p/3159587.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值