Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Search Engine in Rust
Kentaro Matsumoto
July 16, 2019
Programming
0
200
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
our test strategy on actix-web app
matsu7874
0
500
roadmap to rust 2024
matsu7874
1
1k
Rust tutorial for Pythonista
matsu7874
1
380
Mock testing with mockall
matsu7874
0
59
Write Postgres Extensions with Rust!
matsu7874
0
310
Self-learning Rust way with Clippy.
matsu7874
0
530
Property-Based Testing in Rust
matsu7874
0
610
What is std::sync::atomic
matsu7874
0
42
アジャイルな受託開発を3年間やってみて
matsu7874
4
1.1k
Other Decks in Programming
See All in Programming
データ分析やAIの "運用" について考える
mmorito
0
150
Cybozu GoogleI/O 2022 LT会 - Input for all screens
jaewgwon
0
380
Modern Android Developer ~ 안내서
pluu
1
660
UI Testing of Jetpack Compose Apps, AppDevCon
alexzhukovich
0
170
Opsしかやってこなかった私が DevOpsが根付いたチームにJoinした話
yhamano
1
100
ゴーファーくんと辿るプログラミング言語の歴史/history-of-programming-languages-with-gopher
iwasiman
4
2.9k
開発速度を5倍早くするVSCodeの拡張機能を作った
purp1eeeee
2
160
無限スクロールビューライブラリ 二つの設計思想比較
harumak
0
270
git on intellij
hiroto_kitamura
0
170
[DevTrends - Jun/2022] Arquitetura baseada em eventos
camilacampos
0
160
模組化的Swift架構(二) DDD速成
haifengkao
0
390
社用PCのdotfiles管理 / dotfiles-in-company
yammerjp
0
140
Featured
See All Featured
Designing with Data
zakiwarfel
91
3.9k
For a Future-Friendly Web
brad_frost
166
7.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
15
36k
Infographics Made Easy
chrislema
233
17k
Raft: Consensus for Rubyists
vanstee
126
5.4k
Atom: Resistance is Futile
akmur
255
20k
No one is an island. Learnings from fostering a developers community.
thoeni
9
1.3k
Adopting Sorbet at Scale
ufuk
63
7.6k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
172
8.4k
Why Our Code Smells
bkeepers
PRO
324
55k
Fireside Chat
paigeccino
12
1.3k
Principles of Awesome APIs and How to Build Them.
keavy
113
15k
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
実装が見やすい • 読むべし