Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
數位典藏聯合目錄搜尋引擎模組
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Brian Hsu
January 17, 2013
Programming
180
0
Share
數位典藏聯合目錄搜尋引擎模組
Brian Hsu
January 17, 2013
More Decks by Brian Hsu
See All by Brian Hsu
我如何停止憂慮並愛上 Non-MVC Web Framework @ OSDC.tw 2013
brianhsu
6
3.3k
Java XML Processing
brianhsu
0
86
Java Unicode NCR 處理
brianhsu
1
420
如何在 Java App 中導入 Scala @ JavaTWO 2011
brianhsu
1
130
[LT] 自由軟體讓你五分鐘上新聞 @ OSDC.tw 2011
brianhsu
1
100
ScalaTest-連貓都會的單元測試與 BDD @ COSCUP 2010
brianhsu
0
290
Introduction to Scala @ TWJUG 2010/07
brianhsu
1
200
Programming Android Application in Scala @ OSDC.tw 2010
brianhsu
1
120
Other Decks in Programming
See All in Programming
3Dシーンの圧縮
fadis
1
220
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
11
2.6k
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
3
270
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
150
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
240
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
3
600
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
210
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
1
110
AIエージェントの隔離技術の徹底比較
kawayu
0
430
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
210
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
230
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
150
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Context Engineering - Making Every Token Count
addyosmani
9
900
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
290
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Are puppies a ranking factor?
jonoalderson
1
3.4k
Mind Mapping
helmedeiros
PRO
1
210
Un-Boring Meetings
codingconduct
0
300
A designer walks into a library…
pauljervisheath
211
24k
How to build a perfect <img>
jonoalderson
1
5.5k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Typedesign – Prime Four
hannesfritz
42
3k
Transcript
Lucene 搜尋引擎 BrianHsu
[email protected]
Lucene 簡介 • 全文搜尋引擎 – http://lucene.apache.org/ – http://lucene.apache.org/core/3_6_2/gettingstarted.html • 聯合目錄目前使用
3.5 版
Lucene 索引檔 • Lucene 索引檔 – 一整個資料夾 • Lucene Document
– 一份索引檔裡有 0~N 個 Lucene Document • Lucene 欄位 – 每一份 Lucene Document 有 0~N 個 Lucene 欄位 – key1=[value1, value2, value3] – key2=[value1, value2, value3] • 觀察索引檔工具 – http://code.google.com/p/luke/
聯合目錄索引檔 • //140.109.18.152/LuceneIndex – 藏品索引檔 – 五百萬筆的藏品全文搜尋 • //140.109.18.152/CatalogIndex –
分類目錄的索引檔 – 聯合目錄搜尋裡的「符合的分類名稱」
搜尋引擎模組 • 將 Lucene 包裝成聯合目錄專用 • SearchEngine – 核心搜尋功能 •
ArchiveSearch – 聯合目錄搜尋 • AATSearch – 台灣書院搜尋 • ShopSearch – 授權加值平台搜尋
演算法流程 1. 使用者先建立 SearchEngine 的物件,並傳入 Sort 物件指定排序 的方式 2. 使用者呼叫
SearchEngine 中的 search 方法 3. SearchEngine 將使用者傳入的 search 要求轉遞給 Lucene ,並 取得搜尋結果。 4. 針對搜尋的結果數量建立相對應的 SearchResult<T> 物件 5. 透過 SearchResultConverter 將 Lucene 的搜尋結果的每一筆資 料轉成 T 類別,並且放入 SearchResult<T> 容器當中。 6. 利用 Sort 物件排序 SearchResult<T> 物件 7. 返回 SearchResult<T> 物件給使用者
使用方式 • 參照 – ArchiveSearch/src/main/java/example/Test.java – LuceneSearch/javadoc/