分享

nutch内部工作流程 -

 funson 2007-05-25
nutch内部工作流程

nutch内部工作流程

1. 创建一个新的WebDB (admin db -create)。
2. 把开始抓取的跟Url 放入WebDb (inject)。
3. 从WebDb的新 segment 中生成 fetchlist (generate)。
4. 根据 fetchlist 列表抓取网页的内容 (fetch)。
5. 根据抓取回来的网页链接url更新 WebDB (updatedb)。
6. 重复上面3-5个步骤直到到达指定的抓取层数。
7. 用计算出来的网页url权重 scores 更新 segments (updatesegs)。
8. 对抓取回来的网页建立索引(index)。
9. 在索引中消除重复的内容和重复的url (dedup)。
10. 合并多个索引到一个大索引,为搜索提供索引库(merge)。


我的测试机器的执行命令:

cd work/java_work/search_engine/open_src/nutch-0.7.2

一次性:

../bin/nutch crawl urls -dir invader -depth 3 -topN 50

分解:

1. 创建数据库
../bin/nutch admin -local test -create

2. 把根URL放到数据库中
../bin/nutch inject -local test -urlfile urls

3. 把数据库中的URL取出到块中
../bin/nutch generate test test/segments

4. 根据取出的URL进行WEB下载
s1=`ls -d crawl/segments/2* | tail -1`
echo $s1
../bin/nutch fetch test/segments/20060628160619

5. 把下载的web更新到数据库中
../bin/nutch updatedb test test/segments/20060628160619

6. 重复3-5步骤,直至要下载网页树的深度
../bin/nutch generate test test/segments
../bin/nutch fetch test/segments/20060628162458
../bin/nutch updatedb test test/segments/20060628162458

7. 建立索引
../bin/nutch index indexes test/linkdb test/segments/*

j接下来就可以用jsp查询了。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多