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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yoji Shidara
March 10, 2023
Technology
0
390
searchnos について
Yoji Shidara
March 10, 2023
Tweet
Share
More Decks by Yoji Shidara
See All by Yoji Shidara
Searchnos & Search on Nostr
dara
0
300
nostrbuzzsのしくみ
dara
0
560
How nostrbuzzs works
dara
0
120
About searchnos
dara
0
120
HOME, GOPATH and me
dara
3
1.7k
The First Step for Building Groonga Bindings with Golang
dara
6
1.4k
まほうのひととき - The Magic Hour
dara
7
940
JDK CHRONICLE
dara
2
8.8k
Timelapse Introduction
dara
1
670
Other Decks in Technology
See All in Technology
22nd ACRi Webinar - 1Finity Tamura-san's slide
nao_sumikawa
0
130
ECSネイティブのBlue/Green デプロイを攻略しよう ~CodeDeployとの違いから、デプロイフロー実装まで~
ideaws
2
260
【Ubie】AIを活用した広告アセット「爆速」生成事例 | AI_Ops_Community_Vol.2
yoshiki_0316
1
140
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
200
(技術的には)社内システムもOKなブラウザエージェントを作ってみた!
har1101
1
450
プロポーザルに込める段取り八分
shoheimitani
2
800
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
330
#23 Turing × atmaCup 2nd 6th Place Solution + 取り組み方紹介
yumizu
0
140
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
0
170
生成AIと余白 〜開発スピードが向上した今、何に向き合う?〜
kakehashi
PRO
1
250
Claude Code for NOT Programming
kawaguti
PRO
1
270
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
330
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
170
Six Lessons from altMBA
skipperchong
29
4.2k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
450
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
89
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
It's Worth the Effort
3n
188
29k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Agile that works and the tools we love
rasmusluckow
331
21k
Test your architecture with Archunit
thirion
1
2.2k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
99
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 フィルタを学習する、とかはありかもしれない。 運用が大変そう...