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
380
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
Marpを使って登壇資料を作る
matsu7874
0
590
Generate a rust client code by OpenAPI Generator
matsu7874
0
340
ざっと理解するRust 2024 Edition
matsu7874
0
880
プリントデバッグを失敗させないテクニック
matsu7874
1
320
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
170
actix-webを使った開発のハマリポイントを避けたい
matsu7874
0
1k
our test strategy on actix-web app
matsu7874
0
1.5k
roadmap to rust 2024
matsu7874
0
2k
Rust tutorial for Pythonista
matsu7874
2
1.2k
Other Decks in Programming
See All in Programming
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
130
動作確認やテストで漏れがちな観点3選
starfish719
6
1k
SpringBoot3.4の構造化ログ #kanjava
irof
2
1k
PHP ステートレス VS ステートフル 状態管理と並行性 / php-stateless-stateful
ytake
0
100
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
230
SwiftUI Viewの責務分離
elmetal
PRO
1
240
Rails アプリ地図考 Flush Cut
makicamel
1
120
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1k
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
570
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
790
CI改善もDatadogとともに
taumu
0
120
WebDriver BiDiとは何なのか
yotahada3
1
140
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
The Invisible Side of Design
smashingmag
299
50k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
174
51k
Designing Experiences People Love
moore
140
23k
A Modern Web Designer's Workflow
chriscoyier
693
190k
How to Ace a Technical Interview
jacobian
276
23k
Faster Mobile Websites
deanohume
306
31k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Become a Pro
speakerdeck
PRO
26
5.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
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
実装が見やすい • 読むべし