but... There are not many relays that support NIP-50 (Search Capability), so I made one myself. It is a relay-like server, but not a full-featured relay.
seems to be already difficult even just following the current spec It will be difficult to continue to support NIP in the future It will be difficult to operate relays on our own It needs to be added to the user's relay list and have them throw an events to the relay. It will be hard to operate at that quality. It would be good to retrieve the events from an existing relay.
1 and kind 5. Update Elasticsearch state according to events. Searcher When the REQ comes in: Throw a query to Elasticsearch, return results to the client, and send EOSE at the end. Add the connection to the (internal) query subscriber list. Polling at regular intervals: Throw queries with subscribers to Elasticsearch sequentially, and broadcast the new matches to the subscribers.
can be combined into one and thrown to Elasticsearch. As for buzz phrases, it is often the case that several people will subscribe the same query. Can perform searches with complex conditions, as it uses "Simple query string query" https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query- string-query.html
is supported. support kind 0 (NIP-01)...? A bit more intelligent query scheduling, such as polling queries with more subscribers more often. Support language detection and filtering by language...? Support spam filtering...? How to...? Since we have NIP-56, it might be possible to define pubkey of trusted users and learn spam filter from their kind 1984. It would be hard to operate a search engine...