diff --git a/Cargo.toml b/Cargo.toml index 1cb20f65d..5734c3f03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,7 +79,7 @@ anyhow = "1" uuid = { version = "1", features = ["v4", "serde"] } chrono = { version = "0.4", features = ["serde"] } -# HTTP client (webhook delivery, Typesense indexing) +# HTTP client (webhook delivery) reqwest = { version = "0.13", features = ["json", "rustls"], default-features = false } # Cryptography diff --git a/crates/buzz-relay/src/api/bridge.rs b/crates/buzz-relay/src/api/bridge.rs index 64cbac1d1..dc03c29cd 100644 --- a/crates/buzz-relay/src/api/bridge.rs +++ b/crates/buzz-relay/src/api/bridge.rs @@ -773,7 +773,7 @@ pub async fn count_events( /// Decide whether a search hit should be returned to the caller. /// /// Mirrors the WS NIP-50 path's post-filter step in `handlers/req.rs`: -/// Typesense receives only the kind/authors/time pushdown, so any other filter +/// the FTS backend receives only the kind/authors/time pushdown, so any other filter /// constraint (`#p`, `#h`, `#e`, `#d`, `ids`, …) must be enforced here against /// the full stored event. Without this, an authorized engram search such as /// `{"kinds":[30174],"#p":[self]}` would leak text-matching envelopes whose @@ -1571,7 +1571,7 @@ mod tests { /// Setup: two engram envelopes by different agents for different owners. /// An authorized search for `{kinds:[30174], #p:[owner_a]}` would be /// approved by the engram gate (owner_a is querying engrams addressed to - /// them). Typesense's pushdown only carries `kind:=[30174]`, so the + /// them). The FTS pushdown only carries `kind:=[30174]`, so the /// envelope for owner_b can come back as a text-match hit. The post-filter /// in `search_hit_accepted` must reject it. #[test] @@ -1602,7 +1602,7 @@ mod tests { } /// `authors=[agent_a]` search must not return an envelope authored by agent_b, - /// even if Typesense's text match would otherwise surface it. (Typesense does + /// even if the FTS text match would otherwise surface it. (The FTS query does /// carry an `authors` pushdown today, so this is defence-in-depth; mirroring /// the WS contract.) #[test] diff --git a/crates/buzz-relay/src/config.rs b/crates/buzz-relay/src/config.rs index 9824a1663..aacc606d9 100644 --- a/crates/buzz-relay/src/config.rs +++ b/crates/buzz-relay/src/config.rs @@ -31,10 +31,6 @@ pub struct Config { pub database_url: String, /// Redis connection URL used by the pub/sub manager. pub redis_url: String, - /// Typesense search server URL. - pub typesense_url: String, - /// Typesense API key. - pub typesense_key: String, /// Public WebSocket URL of this relay, advertised in NIP-11. pub relay_url: String, /// Maximum number of concurrent WebSocket connections. @@ -177,12 +173,6 @@ impl Config { let redis_url = std::env::var("REDIS_URL").unwrap_or_else(|_| "redis://localhost:6379".to_string()); - let typesense_url = - std::env::var("TYPESENSE_URL").unwrap_or_else(|_| "http://localhost:8108".to_string()); - - let typesense_key = - std::env::var("TYPESENSE_API_KEY").unwrap_or_else(|_| "buzz_dev_key".to_string()); - let relay_url = std::env::var("RELAY_URL").unwrap_or_else(|_| "ws://localhost:3000".to_string()); @@ -400,8 +390,6 @@ impl Config { bind_addr, database_url, redis_url, - typesense_url, - typesense_key, relay_url, max_connections, max_concurrent_handlers, diff --git a/crates/buzz-relay/src/handlers/req.rs b/crates/buzz-relay/src/handlers/req.rs index ebb60f7f9..83c9eb603 100644 --- a/crates/buzz-relay/src/handlers/req.rs +++ b/crates/buzz-relay/src/handlers/req.rs @@ -190,7 +190,7 @@ pub async fn handle_req( } } - // Search filters hit Typesense and return historical hits, then EOSE. + // Search filters hit Postgres FTS and return historical hits, then EOSE. // They are not registered for fan-out. The sensitive-kind gates above // already ran, so an authed member cannot use search to bypass author/#p // rules for kind:30174 or other globally-stored gated kinds. @@ -374,9 +374,9 @@ pub async fn handle_req( ); } -/// Handle a NIP-50 search REQ: query Typesense, fetch full events, deliver results, EOSE. +/// Handle a NIP-50 search REQ: query Postgres FTS, fetch full events, deliver results, EOSE. /// Search subscriptions are one-shot — no persistent subscription is registered. -/// Maximum Typesense pages to fetch per filter (prevents unbounded loops). +/// Maximum FTS pages to fetch per filter (prevents unbounded loops). const MAX_SEARCH_PAGES: u32 = 10; /// Resolve request-local channel access, repairing a stale cache-negative.