NIP-50: Search
NIP-50 defines a general search capability for Nostr relays. It adds full-text style querying on top of NIP-01’s exact-match filters.
How It Works
The protocol adds a search field to filter objects in REQ messages:
- Clients submit a human-readable query string such as
best nostr apps. - Relays interpret that query against event data, primarily the
contentfield. - Results are sorted by match quality, not by
created_at. limitapplies after relevance sorting.
Search filters can be combined with kinds, ids, authors, and other normal filter fields for more specific queries.
Search Extensions
Relays may optionally support these extension parameters:
include:spam- Disables default spam filteringdomain:<domain>- Filters by verified NIP-05 domainlanguage:<code>- Filters by ISO language codesentiment:<value>- Filters by negative, neutral, or positive sentimentnsfw:<true/false>- Includes or excludes NSFW content
Relays should ignore extensions they do not support, so clients need to treat them as hints, not guarantees.
Interop Notes
- Clients should check relay capabilities via the
supported_nipsfield - Client-side verification of results is recommended
- Not all relays implement search; it remains an optional feature
Because ranking is implementation-defined, the same query can return different result sets on different relays. Clients that care about recall should query more than one search relay and merge results.
Why It Matters
Structured filters work well when you already know the author, kind, or tag you want. Search is for the opposite case: discovery. That makes NIP-50 useful for app directories, long archives, and public note search, but it also means search quality depends heavily on each relay’s indexing and spam filtering choices.
Primary sources:
Mentioned in:
See also: