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
390
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
870
Generate a rust client code by OpenAPI Generator
matsu7874
0
410
ざっと理解するRust 2024 Edition
matsu7874
0
1.2k
プリントデバッグを失敗させないテクニック
matsu7874
1
360
社外を巻き込んだ勉強会を定期開催するコツ
matsu7874
0
180
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.3k
Other Decks in Programming
See All in Programming
プロダクト横断分析に役立つ、事前集計しないサマリーテーブル設計
hanon52_
2
470
Unlock the Potential of Swift Code Generation
rockname
0
270
一緒に働きたくなるプログラマの思想 #QiitaConference
mu_zaru
72
17k
「理解」を重視したAI活用開発
fast_doctor
0
190
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
350
Strategic Design (DDD)for the Frontend @DDD Meetup Stuttgart
manfredsteyer
PRO
0
170
Road to RubyKaigi: Making Tinny Chiptunes with Ruby
makicamel
4
460
カオスに立ち向かう小規模チームの装備の選択〜フルスタックTSという装備の強み _ 弱み〜/Choosing equipment for a small team facing chaos ~ Strengths and weaknesses of full-stack TS~
bitkey
1
100
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.6k
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
0
620
Contribute to Comunities | React Tokyo Meetup #4 LT
sasagar
0
550
Exit 8 for SwiftUI
ojun9
0
140
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.4k
Optimizing for Happiness
mojombo
377
70k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
740
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
A better future with KSS
kneath
239
17k
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
実装が見やすい • 読むべし