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 Engine in Rust
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kentaro Matsumoto
July 16, 2019
Programming
0
450
Search Engine in Rust
Rust実装の検索エンジンについてまとめました。2019/07/16
Kentaro Matsumoto
July 16, 2019
Tweet
Share
More Decks by Kentaro Matsumoto
See All by Kentaro Matsumoto
claude_code.pdf
matsu7874
5
7.4k
Marpを使って登壇資料を作る
matsu7874
0
2k
Generate a rust client code by OpenAPI Generator
matsu7874
0
670
ざっと理解するRust 2024 Edition
matsu7874
0
1.8k
プリントデバッグを失敗させないテクニック
matsu7874
1
450
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
220
actix-webを使った開発のハマリポイントを避けたい
matsu7874
0
1.2k
our test strategy on actix-web app
matsu7874
0
1.7k
roadmap to rust 2024
matsu7874
0
2.2k
Other Decks in Programming
See All in Programming
AIに仕事を丸投げしたら、本当に楽になれるのか
dip_tech
PRO
0
170
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
160
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
230
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜 / Understanding nil in Go Interface Representation and Why nil != nil
kuro_kurorrr
3
1.6k
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
1
120
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
500
CSC307 Lecture 12
javiergs
PRO
0
450
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
TipKitTips
ktcryomm
0
140
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
640
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
CSC307 Lecture 14
javiergs
PRO
0
440
Featured
See All Featured
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Utilizing Notion as your number one productivity tool
mfonobong
4
240
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Prompt Engineering for Job Search
mfonobong
0
180
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
170
Site-Speed That Sticks
csswizardry
13
1.1k
Tell your own story through comics
letsgokoyo
1
830
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.1k
First, design no harm
axbom
PRO
2
1.1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
260
Transcript
Search Engine in Rust 2019/07/16 Shinjuku.rs #5 @FORCIA
松本健太郎/@matsu7874 • フォルシア株式会社 エンジニア • インメモリデータベースの開発 ◦ Rustを使用
目次 1. 全文検索エンジン 2. 全文検索エンジンライブラリTantivy
Rust実装の全文検索エンジン
Rustの全文検索エンジン Project Star Contributors Sonic 6887 19 Toshi 2184 14
Rusticsearch 167 1 MeiliDB 133 6
Sonic • RocksDBに依存 ◦ facebookが開発しているkey-value store • 商用利用実績あり!
Toshi • Tantivyを使用 ◦ full-text search engine library • far
from production ready
Rusticsearch • RocksDBに依存 • 開発停止→toshiを見てね
MeiliDB • RocksDBに依存 • meiliというフランスの会社が開発 • beta版でクライアントを探している?
全文検索エンジンライブラリ Tantivy
Tantivy • 全文検索エンジンライブラリ ◦ Apache Lucene的な ◦ 高速な転置インデックスを提供する • 更新も出来るよ
• @fulmicotonさん中心に開発
なんで速いの? • FSTで辞書引き ◦ 有限状態トランスデューサー • delta-encoding ◦ 前の要素との差分を保存する •
bit pack ◦ 5とか7とかは3bitでよくね? ◦ メモリに載るぜ!
インデックス構造 • WORM: write-one-read-many • segmentという小単位で保存 ◦ これは上書きしない
更新もできるの? • add_document, delete_term • 処理はQueueに貯めていく ◦ QueueはRwLock
once_cell::sync::Lazy; • 1回与えられたら、更新されない
Tutorialが簡単 • 500万行8GBのWikipediaデータ • 4並列でindex `-t`オプション • 10分くらいでインデックスできる
Exampleが充実 • custom_tokenizer • custom_collector • update • stop_words
実装が見やすい • 読むべし