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
330
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
ざっと理解するRust 2024 Edition
matsu7874
0
42
プリントデバッグを失敗させないテクニック
matsu7874
0
140
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
150
actix-webを使った開発のハマリポイントを避けたい
matsu7874
0
880
our test strategy on actix-web app
matsu7874
0
1.3k
roadmap to rust 2024
matsu7874
0
1.8k
Rust tutorial for Pythonista
matsu7874
2
1.1k
Mock testing with mockall
matsu7874
0
290
Write Postgres Extensions with Rust!
matsu7874
0
590
Other Decks in Programming
See All in Programming
Async Await: Mastering Python's Time-Bending Tricks - EuroPython2024
yanbo
1
290
AWS CDKにおける「再利用性」を考える / aws-cdk-reusability
gotok365
6
1.3k
Rubyのパフォーマンスプロファイリングの改善 / Enhancing performance profiling for Ruby
osyoyu
1
410
今こそ始める、CDKコンストラクトライブラリ開発 ― 入門から実践まで
tmokmss
1
930
ぼっちを避けて楽しむためのアノテコノテ / Various Tips and Tricks to Avoid Loneliness and Have Fun
nrslib
3
1.7k
DDDを志して3年経ったら「DDDの皮を被ったクリーンアーキテクチャ」になった話【デブサミ2024夏】
texmeijin
1
620
CSC307 Lecture 14
javiergs
PRO
0
220
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
140
Prompt FlowによるLLMアプリケーション開発
yuto2000
1
1k
Clean Architecture by TypeScript & NestJS
ryounasso
0
150
英語
s_shimotori
1
220
Featured
See All Featured
RailsConf 2023
tenderlove
16
720
Designing with Data
zakiwarfel
96
5k
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
The World Runs on Bad Software
bkeepers
PRO
63
11k
Ruby is Unlike a Banana
tanoku
96
10k
Git: the NoSQL Database
bkeepers
PRO
423
64k
Building Your Own Lightsaber
phodgson
101
5.9k
Web Components: a chance to create the future
zenorocha
307
41k
WebSockets: Embracing the real-time Web
robhawkes
59
7.2k
Scaling GitHub
holman
458
140k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
4 Signs Your Business is Dying
shpigford
178
21k
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
実装が見やすい • 読むべし