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
450
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
7.3k
Marpを使って登壇資料を作る
matsu7874
0
2k
Generate a rust client code by OpenAPI Generator
matsu7874
0
660
ざっと理解するRust 2024 Edition
matsu7874
0
1.7k
プリントデバッグを失敗させないテクニック
matsu7874
1
430
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
220
actix-webを使った開発のハマリポイントを避けたい
matsu7874
0
1.1k
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
浮動小数の比較について
kishikawakatsumi
0
200
組織で育むオブザーバビリティ
ryota_hnk
0
180
Event Storming
hschwentner
3
1.3k
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.4k
Data-Centric Kaggle
isax1015
2
800
atmaCup #23でAIコーディングを活用した話
ml_bear
3
470
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
330
CSC307 Lecture 05
javiergs
PRO
0
500
個人開発は儲からない - それでも開発開始1ヶ月で300万円売り上げた方法
taishiyade
0
100
CSC307 Lecture 07
javiergs
PRO
1
560
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
1.5k
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
160
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
460
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
600
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
190
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
The Spectacular Lies of Maps
axbom
PRO
1
540
GraphQLとの向き合い方2022年版
quramy
50
14k
Crafting Experiences
bethany
1
59
A Modern Web Designer's Workflow
chriscoyier
698
190k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
59
The Limits of Empathy - UXLibs8
cassininazir
1
230
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
実装が見やすい • 読むべし