diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2025-03-18 13:05:58 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2025-03-18 13:05:58 -0300 |
| commit | 85ea8ab1245aa89cb612e47ab7511fe3d8bb041c (patch) | |
| tree | d9a6b6b8032ba1d80a5e980a8fc7f15bbf04cbc7 | |
| parent | 0b3eea1053de1e5f2043d89912f10afc2328378c (diff) | |
remove it from nip50 example too.no-batching
| -rw-r--r-- | 50.md | 20 |
1 files changed, 10 insertions, 10 deletions
| @@ -8,11 +8,11 @@ Search Capability | |||
| 8 | 8 | ||
| 9 | ## Abstract | 9 | ## Abstract |
| 10 | 10 | ||
| 11 | Many Nostr use cases require some form of general search feature, in addition to structured queries by tags or ids. | 11 | Many Nostr use cases require some form of general search feature, in addition to structured queries by tags or ids. |
| 12 | Specifics of the search algorithms will differ between event kinds, this NIP only describes a general | 12 | Specifics of the search algorithms will differ between event kinds, this NIP only describes a general |
| 13 | extensible framework for performing such queries. | 13 | extensible framework for performing such queries. |
| 14 | 14 | ||
| 15 | ## `search` filter field | 15 | ## `search` filter field |
| 16 | 16 | ||
| 17 | A new `search` field is introduced for `REQ` messages from clients: | 17 | A new `search` field is introduced for `REQ` messages from clients: |
| 18 | ```jsonc | 18 | ```jsonc |
| @@ -21,23 +21,23 @@ A new `search` field is introduced for `REQ` messages from clients: | |||
| 21 | "search": <string> | 21 | "search": <string> |
| 22 | } | 22 | } |
| 23 | ``` | 23 | ``` |
| 24 | `search` field is a string describing a query in a human-readable form, i.e. "best nostr apps". | 24 | `search` field is a string describing a query in a human-readable form, i.e. "best nostr apps". |
| 25 | Relays SHOULD interpret the query to the best of their ability and return events that match it. | 25 | Relays SHOULD interpret the query to the best of their ability and return events that match it. |
| 26 | Relays SHOULD perform matching against `content` event field, and MAY perform | 26 | Relays SHOULD perform matching against `content` event field, and MAY perform |
| 27 | matching against other fields if that makes sense in the context of a specific kind. | 27 | matching against other fields if that makes sense in the context of a specific kind. |
| 28 | 28 | ||
| 29 | Results SHOULD be returned in descending order by quality of search result (as defined by the implementation), | 29 | Results SHOULD be returned in descending order by quality of search result (as defined by the implementation), |
| 30 | not by the usual `.created_at`. The `limit` filter SHOULD be applied after sorting by matching score. | 30 | not by the usual `.created_at`. The `limit` filter SHOULD be applied after sorting by matching score. |
| 31 | A query string may contain `key:value` pairs (two words separated by colon), these are extensions, relays SHOULD ignore | 31 | A query string may contain `key:value` pairs (two words separated by colon), these are extensions, relays SHOULD ignore |
| 32 | extensions they don't support. | 32 | extensions they don't support. |
| 33 | 33 | ||
| 34 | Clients may specify several search filters, i.e. `["REQ", "", { "search": "orange" }, { "kinds": [1, 2], "search": "purple" }]`. Clients may | 34 | Clients may specify several search filters, i.e. `["REQ", "_", {"kinds": [1], "search": "purple"}]`. Clients may |
| 35 | include `kinds`, `ids` and other filter field to restrict the search results to particular event kinds. | 35 | include `kinds`, `ids` and other filter field to restrict the search results to particular event kinds. |
| 36 | 36 | ||
| 37 | Clients SHOULD use the supported_nips field to learn if a relay supports `search` filter. Clients MAY send `search` | 37 | Clients SHOULD use the supported_nips field to learn if a relay supports `search` filter. Clients MAY send `search` |
| 38 | filter queries to any relay, if they are prepared to filter out extraneous responses from relays that do not support this NIP. | 38 | filter queries to any relay, if they are prepared to filter out extraneous responses from relays that do not support this NIP. |
| 39 | 39 | ||
| 40 | Clients SHOULD query several relays supporting this NIP to compensate for potentially different | 40 | Clients SHOULD query several relays supporting this NIP to compensate for potentially different |
| 41 | implementation details between relays. | 41 | implementation details between relays. |
| 42 | 42 | ||
| 43 | Clients MAY verify that events returned by a relay match the specified query in a way that suits the | 43 | Clients MAY verify that events returned by a relay match the specified query in a way that suits the |