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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kentaro Matsumoto
July 16, 2019
Programming
470
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
claude_code.pdf
matsu7874
5
7.6k
Marpを使って登壇資料を作る
matsu7874
0
2.3k
Generate a rust client code by OpenAPI Generator
matsu7874
0
750
ざっと理解するRust 2024 Edition
matsu7874
0
1.9k
プリントデバッグを失敗させないテクニック
matsu7874
1
480
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
240
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
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
260
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
280
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
180
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.5k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
1k
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
230
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
180
A2UI という光を覗いてみる
satohjohn
1
170
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
16
8.1k
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
430
はてなアカウント基盤 State of the Union
cockscomb
1
1.2k
Featured
See All Featured
Accessibility Awareness
sabderemane
1
150
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
The Curious Case for Waylosing
cassininazir
1
420
Docker and Python
trallard
47
3.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
210
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
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
実装が見やすい • 読むべし