1、基于 Lucene 与 Heritrix 的搜索引擎构建 - I - 摘 要 在互联网蓬勃发展的今天,互联网上的信息更是浩如烟海。人们在享受互联网带来 的便利的同时,却面临着一个如何在如此海量的内容中准确、快捷地找到自己所需要的 信息的问题,由此互联网搜索引擎应运而生。 本文在对搜索引擎的原理、组成、数据结构和工作流程等方面深入研究的基础上, 对搜索引擎的三个核心部分即网络蜘蛛、网页索引和搜索的分析及实现过程进行阐述。 网络蜘蛛部分采用了基于递归和归档机制的 Heritrix 网络搜索;网页索引部分利用开源 的 Lucene 引擎架构设计并实现了一个可复用的、可扩展的索引建立与管理子系统;搜
2、索部分在 Ajax 技术支持上,设计并实现了一个灵活、简洁的用户接口。本系统具有抓 取网页、建立和管理索引、建立索引以及搜索信息等功能,具备一定的应用前景。 关键词:搜索引擎;中文分词;索引关键词:搜索引擎;中文分词;索引 基于 Lucene 与 Heritrix 的搜索引擎构建 - II - The Construction of Search Engine Based on Lucene and Heritrix Abstract The contents on the Web are increasing exponentially as the rapid development of
3、 the Internet. A problem how to obtain the useful information from vast contents quickly and accurately is facing us while people are enjoying the convenience of the Internet. The solver of this problem is Web Search Engine. The analysis and implementation process of three basic components of search
4、 engine(Crawler, Indexer and Searcher) is described in this paper on the basis of further study on the principles, composition, data structure and work flow of search engine. The crawler component is implemented with Heritrix crawler based on the mechanism of recursion and archiving; A reusable, ext
5、ensible index establishment and management subsystem are designed and implemented by open-source package named “Lucene” in the indexer component; The Searcher component based on the Ajax technology is designed and realized as a flexible, concise user interface. The system has some functions, such as
6、 crawling web page, establishment and management index, establishment log and search information, it has a certain application prospect. Key Words:Search Engine;Chinese Word Segmentation;Index 基于 Lucene 与 Heritrix 的搜索引擎构建 - III - 目 录 摘 要 . I Abstract II 1 绪论 1 1.1 项目背景 . 1 1.2 国内外发展现状 . 1 2 系统的开发平台及相关技术 3 2.1 系统开发平台 . 3 2.2 系统开发技术 . 3 2.2.1 Heritrix 网络搜索简介 . 3 2.2.2 Lucene 技术简介 4 2.2.3 Ajax技术简介 4 3 系统分析与设计 6 3.1 系统需求分析 . 6 3.1.1 系统架构分析 6 3.1.2 系统用例模型 7 3.1.3 系统领域模型 10 3.2 系统概要设计 . 11 3.3