upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/50.md
diff options
context:
space:
mode:
authorJon Staab <jstaab@protonmail.com>2023-05-12 05:10:45 -0700
committerGitHub <noreply@github.com>2023-05-12 05:10:45 -0700
commite5302f84c74cf42d878a3ed18257a16bc0d3b748 (patch)
treeb1a3ad9c0317bf7c38f34c500559b66ff7c0a22d /50.md
parent1c728516dfdc7508ce27eda222bde78466e3457d (diff)
parent4208652dc7a39c63c39559b13c656ec30400fcba (diff)
Merge branch 'master' into patch-1
Diffstat (limited to '50.md')
-rw-r--r--50.md49
1 files changed, 49 insertions, 0 deletions
diff --git a/50.md b/50.md
new file mode 100644
index 0000000..5bda355
--- /dev/null
+++ b/50.md
@@ -0,0 +1,49 @@
1NIP-50
2======
3
4Search Capability
5-----------------
6
7`draft` `optional` `author:brugeman` `author:mikedilger` `author:fiatjaf`
8
9## Abstract
10
11Many Nostr use cases require some form of general search feature, in addition to structured queries by tags or ids.
12Specifics of the search algorithms will differ between event kinds, this NIP only describes a general
13extensible framework for performing such queries.
14
15## `search` filter field
16
17A new `search` field is introduced for `REQ` messages from clients:
18```json
19{
20 ...
21 "search": <string>
22}
23```
24`search` field is a string describing a query in a human-readable form, i.e. "best nostr apps".
25Relays SHOULD interpret the query to the best of their ability and return events that match it.
26Relays SHOULD perform matching against `content` event field, and MAY perform
27matching against other fields if that makes sense in the context of a specific kind.
28
29A query string may contain `key:value` pairs (two words separated by colon), these are extensions, relays SHOULD ignore
30extensions they don't support.
31
32Clients may specify several search filters, i.e. `["REQ", "", { "search": "orange" }, { "kinds": [1, 2], "search": "purple" }]`. Clients may
33include `kinds`, `ids` and other filter field to restrict the search results to particular event kinds.
34
35Clients SHOULD use the supported_nips field to learn if a relay supports `search` filter. Clients MAY send `search`
36filter queries to any relay, if they are prepared to filter out extraneous responses from relays that do not support this NIP.
37
38Clients SHOULD query several relays supporting this NIP to compensate for potentially different
39implementation details between relays.
40
41Clients MAY verify that events returned by a relay match the specified query in a way that suits the
42client's use case, and MAY stop querying relays that have low precision.
43
44Relays SHOULD exclude spam from search results by default if they supports some form of spam filtering.
45
46## Extensions
47
48Relay MAY support these extensions:
49- `include:spam` - turn off spam filtering, if it was enabled by default