【正文】
畢業(yè)論文 題 目 : 基于 Lucene 的桌面搜索引擎 學(xué)院: 管理科學(xué)與工程學(xué)院 專業(yè): 信息管理與信息系統(tǒng) 摘 要 隨著 信息資源的高速膨脹 和計(jì)算機(jī)硬件的高速發(fā)展, 個(gè)人 PC 存儲(chǔ)容量變的越來越大。要想 在越來越大硬盤里 ,從海量的資料中查找自己感興趣的文檔 信息也隨之變得越來越困難。而往往操作系統(tǒng)中自帶的搜索器又不能完全滿足我們的需求,因此我們迫切需要一款全新的桌面搜索引擎來幫助我們。 本文首 先簡(jiǎn)單介紹了基于因特網(wǎng)的搜索引擎的系統(tǒng)結(jié)構(gòu)和原理,然后著重介紹了桌面搜索引擎和全文檢索的相關(guān)知識(shí) ,對(duì)基于 Lucene 的 全文檢索引擎的架構(gòu) 原理方面進(jìn)行詳細(xì)的說明 ,同時(shí)對(duì) Lucene 的索引機(jī)制、系統(tǒng)結(jié)構(gòu),以及中文分詞都進(jìn)行了仔細(xì)分析。 然后介紹了本文實(shí)現(xiàn)的一個(gè)基于 Lucene 的桌面搜索引擎。本桌面搜索引擎 一個(gè)輕量級(jí)的全文檢索軟件,能夠幫助用戶方便地在越來越大硬盤里,從海量的資料中查找自己感興趣的文檔 。從指定的文件路徑中按照目錄層次進(jìn)行解析、搜索,并把搜索到的每條信息進(jìn)行索引后加入索引文件,然后通過 Web 服務(wù)器接 受客戶端請(qǐng)求后從索引文件中搜索出所匹配的信息。 關(guān)鍵詞: 桌面搜索引擎 、 倒排索引、 lucene、 B/S、文本文件 Abstract This article fist introduces the system structure and principle of search engine based on the inter in detail, then gives a minute explanation form Based on the fulltext search engine Lucene framework and principle. In order to understand the technology more deeply, I have programmed a news search engine by myself. The news search engine is explained and searched according to documentlevel directory, then indexs every searched information and adds it to the index file. Then after receiving the customers39。 requests from the web server, it soon searchs the right information form the index engine. In the chapter of introducing search engine, it is not only elaborate the core technology, but also bine with the modern code,pictures included, easy to understand. Key Words: search engine、 lucene、 B/S、 file 目錄 緒論 ................................................................... 4 1. 桌面搜索引擎與全文檢索 .............................................. 6 搜索引擎的概念及發(fā)展 .............................................................................................. 6 桌面搜索引擎簡(jiǎn)介 ..................................................................................................... 7 Windows 自帶搜索功能 的不足 ......................................................................... 7 我們需要一款桌面搜索引擎 ............................................................................. 7 桌面搜索引擎現(xiàn)狀 ........................................................................................... 7 全文檢索 ................................................................................................................... 8 什么是全文檢索與全文檢索系統(tǒng) ...................................................................... 8 全文檢索原理 .................................................................................................. 9 全文檢索的倒排索引原理 ............................................................................... 12 2. 開放源代碼的全文檢索引擎架構(gòu) Lucene................................. 14 Lucene 簡(jiǎn)介 ............................................................................................................. 14 什么是 Lucene ............................................................................................... 14 Lucene 的應(yīng)用、特點(diǎn)及優(yōu)勢(shì) .......................................................................... 14 Lucene系統(tǒng)結(jié)構(gòu)分析 ............................................................................................. 15 深入 Lucene 索引機(jī)制 ........................................................................................... 17 Lucene文檔分析與中文分詞 .................................................................................. 19 Lucene 分析器原理 ....................................................................................... 19 中文分詞 ..................................................................................................... 21 Lucene 的索引效率 .................................................................................................. 26 從 Lucene 學(xué)到更多 ................................................................................................. 27 3. 基于 Lucene 的桌面搜索引擎 .......................................... 28 功能簡(jiǎn)介 ................................................................................................................. 28 桌面搜索引擎 — 索引器設(shè)計(jì) ..................................................................................... 29 索引器簡(jiǎn)介 .................................................................................................... 29 界面設(shè)計(jì) ....................................................................................................... 29 功能設(shè)計(jì) ....................................................................................................... 30 桌面搜索引擎 — 索引器實(shí)現(xiàn) ..................................................................................... 31 解析器實(shí)現(xiàn) .................................................................................................... 31 中文分詞考慮 ................................................................................................ 34 索引器實(shí)現(xiàn) .................................................................................................... 35 搜索器實(shí)現(xiàn) ............................................................................................................. 38 搜索器簡(jiǎn)介 .................................................................................................... 38 搜索器界面 .................................................................................................... 38 搜索器實(shí)現(xiàn) .................................................................................................... 39 實(shí)例演示 ....................................................................................................... 40 數(shù)據(jù)持久化 ............................................................................................................. 41 持久化簡(jiǎn)介 .......................................................................