分类号:TP311.1 U D C:D10621-408-(2007)5819-0
密 级:公 开 编 号:2003032115
成 都 信 息 工 程 学 院
学 位 论 文
基于 Ajax+Lucene 构建搜索引擎的设计与实现
论 文 作 者 姓 名 :
闫秋云
申 请 学 位 专 业 :
网络工程
申 请 学 位 类 别 :
工学学士
指导教师姓名(职称):
方睿(副教授)
论 文 提 交 日 期 :
2007 年 06 月 10 日
基于 Ajax+Lucene 构建搜索引擎的设计与实现
摘 要
通过搜索引擎从互联网上获取有用信息已经成为人们生活的重要组成部分,
Lucene 是构建搜索引擎的其中一种方式。搜索引擎系统是在.Net 平台上用 C#开
发的,数据库是 MSSQL Server 2000。主要完成的功能有:用爬虫抓取网页;获
取有效信息放入数据库;通过 Lucene 建立索引;对简单关键字进行搜索;使用
Ajax 的局部刷新页面展示结果。
论文详细说明了系统开发的背景,开发环境,系统的需求分析,以及功能的
设计与实现。同时讲述了搜索引擎的原理,系统功能,并探讨使用 Ajax 与服务
器进行数据异步交互,从而改善现有的 Web 应用模式。
关键词:Lucene.net;异步更新;Ajax;搜索引擎
The Design and Implementation for Constructing the Search
Engine with Ajax and Lucene
Abstract
Obtaining useful information from web by search engines has become the
important part of people's lives. Lucene is the way of constructing search engine. This
system is based on the .Net platform using C#. The database is MSSQL Server 2000.
Main functions are grasping web pages with crawls, adding effective information to
the database, establishing index with Lucene, searching through keywords, and
displaying the results finally.
This paper has showed the principle of search engine in the form of different
modules, functions of this system, improving traditional web application model using
Ajax. It shows explanation of the system’s background, development environment,
system analysis of demanding, and functions of design.
Key words: Lucene.net; Asynchronous update; Ajax; Search engines
目 录
论文总页数:19 页
1 引言 ...............................................................................................................................................1
1.1 课题背景............................................................................................................................1
1.2 国内外研究现状................................................................................................................1
1.3 本课题研究的意义............................................................................................................1
1.4 本课题的研究方法............................................................................................................1
2 Lucene.net 构建搜索引擎原理......................................................................................................2
2.1 全文搜索引擎....................................................................................................................2
2.1.1 搜索引擎的分类 .....................................................................................................2
2.1.2 搜索引擎的工作原理 .............................................................................................2
2.2 LUCENE 与搜索引擎..........................................................................................................3
2.3 索引和搜索........................................................................................................................4
2.4 AJAX 技术............................................................................................................................4
3 需求分析 .......................................................................................................................................5
3.1 同步环境............................................................................................................................5
3.2 功能需求 ............................................................................................................................6
3.3 性能需求............................................................................................................................6
3.4 输入输出要求....................................................................................................................7
3.5 运行需求............................................................................................................................7
4 方案设计 .......................................................................................................................................7
4.1 搜索引擎模型....................................................................................................................7
4.2 数据库的设计....................................................................................................................7
4.3 模块设计............................................................................................................................8
5 系统实现 .....................................................................................................................................10
5.1 开发环境..........................................................................................................................10
5.2 关键代码详解..................................................................................................................10
5.2.1 代码结构 ...............................................................................................................10
5.2.2 爬虫部分 ...............................................................................................................11
5.2.3 索引生成 ................................................................................................................12
5.2.4 页面查询 ................................................................................................................13
6 测试 .............................................................................................................................................14
6.1 功能测试..........................................................................................................................14
结 论 .........................................................................................................................................16
参考文献 .........................................................................................................................................17
致 谢 .........................................................................................................................................18
声 明 .........................................................................................................................................19