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
Kentaro Matsumoto
July 16, 2019
Programming
460
0
Share
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.4k
Marpを使って登壇資料を作る
matsu7874
0
2.2k
Generate a rust client code by OpenAPI Generator
matsu7874
0
690
ざっと理解するRust 2024 Edition
matsu7874
0
1.8k
プリントデバッグを失敗させないテクニック
matsu7874
1
460
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
230
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
How to stabilize UI tests using XCTest
akkeylab
0
150
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.5k
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
5.4k
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
250
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
150
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
200
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
140
AI活用のコスパを最大化する方法
ochtum
0
370
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
290
20260315 AWSなんもわからん🥲
chiilog
2
180
KagglerがMixSeekを触ってみた
morim
0
360
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
230
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
730
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
99
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
500
The Spectacular Lies of Maps
axbom
PRO
1
670
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
280
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
How GitHub (no longer) Works
holman
316
150k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Rails Girls Zürich Keynote
gr2m
96
14k
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
実装が見やすい • 読むべし