From ebd18d5ccadf6236463b62984a3acf45b29dffa6 Mon Sep 17 00:00:00 2001 From: Viktor Vsk Date: Sat, 9 Sep 2023 13:19:01 +0200 Subject: [PATCH] NIP-50 search filter should work with multiple values to use them with AND condition in the same way `kinds` and `authors` are used --- 50.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/50.md b/50.md index 5bda3559..4fc6a052 100644 --- a/50.md +++ b/50.md @@ -18,10 +18,10 @@ A new `search` field is introduced for `REQ` messages from clients: ```json { ... - "search": + "search": } ``` -`search` field is a string describing a query in a human-readable form, i.e. "best nostr apps". +`search` field is a list of strings describing a query in a human-readable form, i.e. "best nostr apps". Relays SHOULD interpret the query to the best of their ability and return events that match it. Relays SHOULD perform matching against `content` event field, and MAY perform matching against other fields if that makes sense in the context of a specific kind. @@ -29,7 +29,7 @@ matching against other fields if that makes sense in the context of a specific k A query string may contain `key:value` pairs (two words separated by colon), these are extensions, relays SHOULD ignore extensions they don't support. -Clients may specify several search filters, i.e. `["REQ", "", { "search": "orange" }, { "kinds": [1, 2], "search": "purple" }]`. Clients may +Clients may specify several search filters, i.e. `["REQ", "", { "search": ["orange"] }, { "kinds": [1, 2], "search": ["green", "purple"] }]`. Clients may include `kinds`, `ids` and other filter field to restrict the search results to particular event kinds. Clients SHOULD use the supported_nips field to learn if a relay supports `search` filter. Clients MAY send `search`