add simple fulltext search
Some checks failed
Go / build (push) Has been cancelled

This commit is contained in:
2025-10-10 09:17:53 +01:00
parent 27af174753
commit 2637f4b85c
3 changed files with 343 additions and 9 deletions

View File

@@ -650,6 +650,31 @@ export async function fetchUserEvents(pubkey, options = {}) {
return events;
}
// NIP-50 search function
export async function searchEvents(searchQuery, options = {}) {
const {
limit = 100,
since = null,
until = null,
kinds = null
} = options;
const filters = {
search: searchQuery
};
if (since) filters.since = since;
if (until) filters.until = until;
if (kinds) filters.kinds = kinds;
const events = await fetchEvents(filters, {
limit: limit,
timeout: 30000
});
return events;
}
// Initialize client connection
export async function initializeNostrClient() {