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
470
0
Share
Search Engine in Rust
Rust実装の検索エンジンについてまとめました。2019/07/16
Kentaro Matsumoto
July 16, 2019
More Decks by Kentaro Matsumoto
See All by Kentaro Matsumoto
claude_code.pdf
matsu7874
5
7.5k
Marpを使って登壇資料を作る
matsu7874
0
2.2k
Generate a rust client code by OpenAPI Generator
matsu7874
0
710
ざっと理解するRust 2024 Edition
matsu7874
0
1.8k
プリントデバッグを失敗させないテクニック
matsu7874
1
470
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
230
actix-webを使った開発のハマリポイントを避けたい
matsu7874
0
1.2k
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
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
170
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
270
Running Swift without an OS
kishikawakatsumi
0
850
From Formal Specification to Property Based Test
ohbarye
0
190
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
0
400
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
280
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
280
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
570
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
220
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3k
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
180
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
340
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
Color Theory Basics | Prateek | Gurzu
gurzu
0
290
Discover your Explorer Soul
emna__ayadi
2
1.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
210
The Spectacular Lies of Maps
axbom
PRO
1
710
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
200
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
110
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
170
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
実装が見やすい • 読むべし