Closed alexgleason closed 9 months ago
I also created this version which supports empty kinds
, but it has other problems:
elseif haskey(filt, "search")
kinds = get(filt, "kinds", [0, 1])
for kind in kinds
if kind === 0
kwargs = [
:query=>filt["search"],
:limit=>get(filt, "limit", 10)
]
app_funcall(:user_search, kwargs, sendres; subid, ws_id=ws_id)
elseif kind === 1
kwargs = [
:query=>filt["search"],
:limit=>get(filt, "limit", 20),
:since=>get(filt, "since", 0),
:until=>get(filt, "until", nothing)
]
app_funcall(:search, kwargs, sendres; subid, ws_id=ws_id)
end
end
This version is a little bit more beautiful and semantically correct, but the first filter will EOSE before the second one completes, which is worse behavior than this MR. It's because the cache handlers don't actually support multiple filters properly. So I still think this MR is better without other changes.
Related to #13
Adds support for NIP-50 search queries.
The following filters will work:
If you try to filter for unsupported kinds, it will error.
In the future, we should preprocess filters, and if a
search
filter doesn't havekinds
, split it into two separate filters for[0]
and[1]
.