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
searchnos について
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yoji Shidara
March 10, 2023
Technology
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
searchnos について
Yoji Shidara
March 10, 2023
More Decks by Yoji Shidara
See All by Yoji Shidara
Searchnos & Search on Nostr
dara
0
350
nostrbuzzsのしくみ
dara
0
610
How nostrbuzzs works
dara
0
160
About searchnos
dara
0
160
HOME, GOPATH and me
dara
3
1.7k
The First Step for Building Groonga Bindings with Golang
dara
6
1.5k
まほうのひととき - The Magic Hour
dara
7
980
JDK CHRONICLE
dara
2
8.8k
Timelapse Introduction
dara
1
700
Other Decks in Technology
See All in Technology
Kaggleで成長するために意識したこと
prgckwb
2
370
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
150
Gen3R: 3D Scene Generation Meets Feed-Forward Reconstruction
spatial_ai_network
0
130
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.4k
Empower GenAI with Agile - あなたのアジャイルが生成AIのバフになる仕組み
hageyahhoo
1
190
Genie Ontologyは銀の弾丸かを考える / Is Genie Ontology a Silver Bullet?
nttcom
0
310
ボーイスカウトルールでメモリやスキルを改善しよう
azukiazusa1
4
1.2k
AI Driven AI Governance
pict3
0
440
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
1
250
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
150
ローカルLLMとLINE Botの組み合わせ その3 / LINE DC Generative AI Meetup #8
you
PRO
0
130
Claude Code 珍プレー好プレー
shinyasaita
0
330
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
220
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
330
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
270
Skip the Path - Find Your Career Trail
mkilby
1
170
Discover your Explorer Soul
emna__ayadi
2
1.2k
KATA
mclloyd
PRO
35
15k
Accessibility Awareness
sabderemane
1
150
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
180
Transcript
searchnos について npub1q7qyk7rvdga5qzmmyrvmlj29qd0n45snmfuhkrzsj4rk0sm4c4psvqwt9c 2023-03-10 Nostr 勉強会 #1
@darashi nostrbuzzs の作者です。
searchnos とは https://github.com/darashi/searchnos Nostrbuzzs に検索機能がほしい、けど... NIP-50 (Search Capability; 検索) 対応のリレーが少ないので、自分で作ってみまし
た。 リレー風のサーバですが、フル機能のリレーではありません。
None
考えたこと リレーを自前で作るのは大変そう 現状でも既に大変そう 今後の NIP に対応し続けるのも大変そう リレーを自前で運用するのも大変そう ユーザのリレーリストに追加してもらい、こちらにイベントを投げてもらわ ないといけない。 そのレベルのものを運用するのは大変そう。
→ イベントは既存のリレーから取得するのがよさそう。小判鮫的な。
しくみ searchnos indexer searcher relay-1 relay-2 Elasticsearch web-browser
indexer 指定したリレーに接続し、kind1 とkind5 を購読する。イベントに応じて Elasticsearch の状態を更新する。 searcher REQ が来たら、 Elasticsearch
にクエリを投げて、結果を返し、最後にEOSE を送る。 (内部的な)クエリ購読者リストに追加する。 一定時間ごとにポーリング 購読者があるクエリを順番に Elasticsearch に投げて、新着の結果を購読者に 流す。
client searcher Elasticsearch indexer relay loop loop REQ w/"search" 1
query 2 response 3 EVENT (if matched) 4 EVENT (if matched) 5 EOSE 6 kind:1 7 index request 8 wait 9 query 10 response 11 EVENT (if matched & unread) 12 CLOSE 13 client searcher Elasticsearch indexer relay
おもしろポイント 同じクエリを購読しているクライアントのクエリは、一つにまとめて Elasticsearch に投げる。 buzzphrases に関していうと、何人もが同じクエリを購読することがよくあ る。 Simple query string
query ※ を使っているので、複雑な条件を持つ検索ができる ※ https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple- query-string-query.html
まとめ 既存のリレーから note を収集し、 NIP-50 に対応した検索機能を提供するリレー っぽいサーバーを作った。
今後の課題 通常のフィルタ条件 (NIP-01) に対応する。 現状 limit にしか対応できていない kind:0 (NIP-01) にも対応する...?
購読者の多いクエリは頻繁にポーリングするなど、もう少し賢いクエリスケジュ ーリング。 言語推定と言語によるフィルタリングに対応する...? spam フィルタに対応する...? どうやって...? NIP-56 があるので、信頼できるユーザの pubkey を定義して、その kind:1984 から spam フィルタを学習する、とかはありかもしれない。 運用が大変そう...