ArachNode.Net 之配置

 

1、首先运行存储过程:dbo.arachnode_usp_arachnode.net_RESET_DATABASE或者从类 Arachnode.Console。Pragram.cs中执行

ArachnodeDAO arachnodeDAO = new ArachnodeDAO();
arachnodeDAO.ExecuteSql("EXEC [dbo].[arachnode_usp_arachnode.net_RESET_DATABASE]");

 _crawler.Crawl(new CrawlRequest(new Discovery("http://taobao.com"), int.MaxValue, UriClassificationType.Domain | UriClassificationType.FileExtension, UriClassificationType.Domain | UriClassificationType.FileExtension, 1));

2、在SQL  Server 2008数据库中,对表cfg.Configuration执行如下一段代码:

use [arachnode.net]
  update cfg.Configuration 
  set Value = 'D:\LuceneDotNetIndex\Index'
  where [KEY] = 'LuceneDotNetIndexDirectory'
  
  update cfg.Configuration 
  set Value = 'D:\LuceneDotNetIndex\DownloadedFiles'
  where [KEY] = 'DownloadedFilesDirectory'

  update cfg.Configuration 
  set Value = 'D:\LuceneDotNetIndex\DownloadedImages'
  where [KEY] = 'DownloadedImagesDirectory'
  
  update cfg.Configuration 
  set Value = 'D:\LuceneDotNetIndex\DownloadedWebPages'
  where [KEY] = 'DownloadedWebPagesDirectory'
  
  update cfg.Configuration 
  set Value = 'D:\LuceneDotNetIndex\ConsoleOutputLogs'
  where [KEY] = 'ConsoleOutputLogsDirectory'

3、将数据库中的表cfg.CrawlActions中的字段

AutoCommit=true|LuceneDotNetIndexDirectory=D:\LuceneDotNetIndex\Index|CheckIndexes=false|RebuildIndexOnLoad=false|WebPageIDLowerBound=1|WebPageIDUpperBound=100000

 

4、配制数据库的链接:

Arachnode.Configuration中的

 connectionString="Data Source=HENRYWEN-TUCU\SQLEXPRESS;Initial Catalog=arachnode.net;Integrated Security=True;Connection Timeout=3600;"或者项目Function右键--属性--数据库--连接字符

5、去掉开发工具(VS2008):look up turning off 'Just My Code' - this is a Visual Studio option

工具--选项--调试--去掉启用仅我的代码

 

  • 首先按照百度百科“Arachnode.net”词条的内容把该执行的斗志行了,该打开的都打开了。
  • 在表“dbo.CrawlRequests”中添加需要怕的网站信息。注意起始地址“AbsoluteUri”字段有约束条件,不能包含"http://www",但是必须包含“http://”,且至少含有三个“/”。
  • 在表“cfg.Configuration”中指定“DownloadedFilesDirectory”、“DownloadedImagesDirectory”、“DownloadedWebPagesDirectory”、“LuceneDotNetIndexDirectory”四个字段的值,都是本地磁盘目录路径。
  • 在表“cfg.CrawlActions”中包含“LuceneDotNetIndexDirectory”的“Settings”行中给“LuceneDotNetIndexDirectory=”后面加上本地磁盘路径。不知道是否必须和上面的LuceneDotNetIndexDirectory一致。
最后把console main中的
 wasTheCrawlRequestAddedForCrawling = _crawler.Crawl(new CrawlRequest(new Discovery(" http://nbc.com"), int.MaxValue, UriClassificationType.None, UriClassificationType.None, 1, RenderType.None, RenderType.None));
                 改成自己的链接即可测试

 

 

转载于:https://www.cnblogs.com/lidaohang/archive/2011/01/01/1923868.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值