There can be no Triumph without Loss,No Victory without Suffering,No Freedom without Sacrifice.
All you have to decide is what to do with the time that is given to you.
Get busy Living, or Get busy Dying?
  首页 | 留言给我 | 订阅 Rss | CLI | 黄白之恋 Posts:158   Hits: 5010832    Comments: 173    
 日历归档
<<  <  2024 - 03  >  >>
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930
31
 About Me
 Name: ZhangSichu
 Sex: Male
 Age: 32
 Email: ZhangSichu@gmail.com
 MSN: ZhangSichu@hotmail.com
 Home: ZhangSichu.com
 WeiBo: weibo.com/zhangsichu
 个人推荐
 分类归档
  ·C++/C(5)  RSS
  ·软件工程(1)  RSS
  ·杂事/随感(26)  RSS
  ·.Net/Java(30)  RSS
  ·面向对象程序设计(5)  RSS
  ·汇编/破解(0)  RSS
  ·平面设计(3)  RSS
  ·SQL(5)  RSS
  ·COM/COM+(2)  RSS
  ·Web开发(81)  RSS
 My Friends
Back Forward Refresh Home 2024年3月28日 星期四 RSS CLI Mine Sweeper. In Javascript.

  WebLinkSpider 简单搜索引擎分析
字体大小 [ ]

WebLinkSpider网络爬虫。很多网站都会发现,经常有搜索引擎在访问自己的网站。搜索引擎访问网站是为了采集这个网站的信息,为搜索引擎提供内容服务。这种爬虫就是从页面中的一个链接跳到另一链接就这样一次又一次的跳,收集每个页面的信息,存储起来,为搜索引擎提供内容服务。
有了这些内容,当用户进行搜索的时候,搜索引擎从中找到相关的内容,把对应的Url和相关的内容返回给用。就完成了一个简单的搜索。
现在大型的搜索引擎都不把爬虫采集来的信息放在数据库中。因为数据库在分布式处理 网格计算 负载平衡 上的表现都不是很满意。存储的信息一般都以文件的形式来存放。然后再这些内容上进行全文检索,这样的全文检索对网格计算和负载平衡支持的很好。

Luncene 是这种搜索技术的代表开源项目。

Apache Lucene http://lucene.apache.org/java/docs/
Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.
Apache Lucene is an open source project available for free download.

Dot Lucene http://www.dotlucene.net/
Base on M$ .Net Lucene also open source.

Lucene China http://www.lucene.com.cn/yanli.htm
China Lucene.

大型的搜索引擎中还加入了分词和语义解析的功能,使得搜索更方便,得到结果更加符合搜索的意图。
自己也根据搜索引擎的工作方式,写了一个爬虫:) 采集来的数据放在SQL Server中。使用动态规划 动态剪枝 提高采集性能。
支持以Single形式运行和以Service形式运行。

LinkInfo.xml 是采集配置信息
<Link>
<StartUrl>http://www.tom.com</StartUrl>
<UrlText><![CDATA[Tom 首页]]></UrlText>
<WantedDepth>10</WantedDepth>
<MaxDepth>1000</MaxDepth>
<StartTime>22:50:00</StartTime>
<AllowMinuteSpan>5</AllowMinuteSpan>
<Timeout>10675190</Timeout>
</Link>
StartUrl      采集站点的起始Url.
UrlText        本Url的描述信息。可以不写。
WantedDepth      想要采集的深度,-1表示无限深。
MaxDepth      当WantedDepth =-1时的限制深度。
AllowMinuteSpan      当以Service启动时,检查时间允许的误差。单位分钟。
Timeout      当这个网站采集消耗的时间超过Timeout设定的时间时,中止采集。
StartTime    在以Service运行的情况下,当当前的时间等于StartTime时运行这个采集Link。当以Single模式运行时。StartTime没有用。


DBInfo.xml 数据库链接信息
<?xml version="1.0" encoding="utf-8" ?>
<WebLinkSpiderDBInfo Name="NiceWebSpider" Author="www.xdnice.com" Copyright="xdnice" Url="http://www.xdnice.com" Description="Web Link Spider Application Setting" version="1.0.0">
<ConnectionString>Data Source=Localhost\SQLEXPRESS;Initial Catalog=Test_DB;Integrated Security=True</ConnectionString>
</WebLinkSpiderDBInfo>
ConnectionString      数据库链接信息

SpiderService.exe.config  Service配置信息
<add key="CheckPeriod" value="300000"/>
<add key="WebLinkSpiderExeName" value="WebLinkSpider.exe" />
CheckPeriod      服务检查的周期
WebLinkSpiderExeName  爬虫程序的名字


4个网站10层深度爬的结果
Click to Open in New Window

File: WebLinkSpider Download
  Posted @ 3/2/2007 4:08:14 PM | Hits (62013) | Comment (0

  Post Comment
标题 *
作者 *
密码 记住我
评论 *
    


Stable in Firefox 1.5 2.0Stable in IE6 IE7Stable in MozillaStable in Netscape
ZhangSichu.com V0.1.7507
Powered By ZhangSichu
Copyright © ZhangSichu
Download ZhangSichu.com source code. Download source code