code wiki / _hdl_build / nx_site_search.nx
nx_site_search.nx
buildroot/runtime/_hdl_build/nx_site_search.nx
about
nx_site_search.nx -- the live /search ENDPOINT handler for a public site (operator: wire the live /search). PURE
bytes-in/bytes-out (sr_handle, the nx_status_daemon pattern -- the gate drives it in-process, no socket): on
GET /search?q=<terms> it loads the site's PERSISTED onsite index + manifest (the SAME nx_search_inverted_persist
the proven nx_onsite_search CLI uses), unions the matching docs, and renders a branded results page whose links
are the canonical /practice/<slug> URLs (which the data-driven pages from nx_site_pages now resolve). Composes
the existing search engine -- no new ranking math. Wiring it as the GET /search route in the sites daemon is the
deploy step. license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_search_inverted_persist.nxnx_syscalls.nx
imported by: nx_site_search_gate.nx
structs
| none |
consts
| 10 | const SR_MAGIC_262144: i64 = 262144 |
| 12 | const SR_MAX_TERMS: i64 = 8 |
| 13 | const SR_ROWID_CAP: i64 = 16384 |
functions
| 15 | func sr_cat(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o } |
| 16 | func sr_catn(out: *u8, o: i64, v: i64) -> i64 |
| 22 | func sr_hexnib(c: i64) -> i64 { if c >= 48 { if c <= 57 { return c - 48 } } if c >= 97 { if c <= 102 { return c - 87 } } if c >= 65 { if c <= 70 { return c - 55 } } return 0 - 1 } called by 1: sr_query |
| 25 | func sr_query(req: *u8, n: i64, out: *u8, cap: i64) -> i64 |
| 48 | func sr_resp(out: *u8, body: *u8, bo: i64) -> i64 |
| 57 | func sr_handle(req: *u8, n: i64, idx_path: *u8, manifest_path: *u8, base_url: *u8, firm: *u8, out: *u8) -> i64 |