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
0
420
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
6.8k
Marpを使って登壇資料を作る
matsu7874
0
1.3k
Generate a rust client code by OpenAPI Generator
matsu7874
0
520
ざっと理解するRust 2024 Edition
matsu7874
0
1.5k
プリントデバッグを失敗させないテクニック
matsu7874
1
400
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
200
actix-webを使った開発のハマリポイントを避けたい
matsu7874
0
1.1k
our test strategy on actix-web app
matsu7874
0
1.6k
roadmap to rust 2024
matsu7874
0
2.1k
Other Decks in Programming
See All in Programming
ワープロって実は計算機で
pepepper
2
1.4k
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
1.4k
KessokuでDIでもgoroutineを活用する / Go Connect #6
mazrean
0
120
Kiroで始めるAI-DLC
kaonash
2
460
RDoc meets YARD
okuramasafumi
4
160
レガシープロジェクトで最大限AIの恩恵を受けられるようClaude Codeを利用する
tk1351
4
1.5k
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
17
9.5k
ECS初心者の仲間 – TUIツール「e1s」の紹介
keidarcy
0
140
Ruby Parser progress report 2025
yui_knk
1
250
MLH State of the League: 2026 Season
theycallmeswift
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
260
フロントエンドのmonorepo化と責務分離のリアーキテクト
kajitack
2
150
Featured
See All Featured
How to Ace a Technical Interview
jacobian
279
23k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Thoughts on Productivity
jonyablonski
69
4.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
KATA
mclloyd
32
14k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
The Language of Interfaces
destraynor
160
25k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
790
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
実装が見やすい • 読むべし