Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Search Engine in Rust
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kentaro Matsumoto
July 16, 2019
Programming
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Search Engine in Rust
Rust実装の検索エンジンについてまとめました。2019/07/16
Kentaro Matsumoto
July 16, 2019
More Decks by Kentaro Matsumoto
See All by Kentaro Matsumoto
AIで仕事のやり方を変える
matsu7874
3
1.6k
claude_code.pdf
matsu7874
5
7.7k
Marpを使って登壇資料を作る
matsu7874
0
2.5k
Generate a rust client code by OpenAPI Generator
matsu7874
0
830
ざっと理解するRust 2024 Edition
matsu7874
0
2k
プリントデバッグを失敗させないテクニック
matsu7874
1
510
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
260
actix-webを使った開発のハマリポイントを避けたい
matsu7874
0
1.3k
our test strategy on actix-web app
matsu7874
0
1.8k
Other Decks in Programming
See All in Programming
[2026-10-09]一枚の布で作らなくてもいい。 信頼性は「パッチワーク」で紡がれる~既存の運用と新しい可能性をつなぎ合わせてきたCREの話~
tosite
0
120
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
270
Vue Fes Japan の “作る側”に関わってみて
naokihaba
1
200
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
3
620
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.6k
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1.5k
オーケストレーション記述言語 Katari
yukikurage
0
200
Groovy as a human and AI friendly programming language
paulk
0
130
Spec-driven Development with AI
simas
PRO
0
2.2k
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
140
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
残高管理から台帳サービスへの進化
artoy
1
220
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
950
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Building an army of robots
kneath
307
47k
Believing is Seeing
oripsolob
1
260
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
How to Talk to Developers About Accessibility
jct
2
600
The Cult of Friendly URLs
andyhume
79
7k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
540
Deep Space Network (abreviated)
tonyrice
0
390
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
290
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
2
960
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
実装が見やすい • 読むべし