code wiki / (root) / nx_search_server.nx

nx_search_server.nx

buildroot/runtime/nx_search_server.nx

12455 B263 linesdepth 6pulls 14 transitivereach 0 importersview sourcekind servicetopic search
docsdependenciesstructsconstsfunctions

about

nx_search_server.nx -- the LIVE bits-up search site (sovereign HTTP server). module: nishi-core.search.server depends: nx_http_server.nx, nx_rank_fused.nx, nx_diora_data.nx, fx.nx, nx_str.nx capability: APP_RUNNABLE (DAEMON) Serves a real search site over our own HTTP server (no nginx/libc): GET / -> the search page (query box) GET /search?q=.. -> runs nx_rank_fused over the indexed corpus and returns ranked results (facet + source tier + primary star) The corpus is loaded at startup from nx_diora_data (the verified Diora docs -- the stand-in for crawled content); in the networked env the crawler (nx_crawl_doc/frontier) fills the same arrays from live scraping. Ranking is LIVE per query: tier prior + BM25 content, fused via RRF -- so a unique low-tier page outranks a thin high-tier one. Deterministic Q16.16.

dependencies 6 imports · 0 importers

fx.nx nx_str.nx nx_http_server.nx nx_rank_fused.nx nx_search_inverted.nx nx_diora_data.nx nx_search_server.nx

imports: fx.nxnx_str.nxnx_http_server.nxnx_rank_fused.nxnx_search_inverted.nxnx_diora_data.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_diora_qn nx_diora_fill_qrels nx_str_len nx_http_server_addr_any nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen nx_http_server_accept_one sys_accept nx_http_server_read_reques sys_read nx_http_parse_request bput nx_str_len ↻ bputc nx_extract_query nx_hexval bputc ↻ nx_split_terms nx_rank_fused nx_tier_classify nx_tier_of_url nx_tier_host_has nx_str_str nx_str_len ↻ nx_tier_is_derivative nx_tier_ci_contains nx_str_len ↻ nx_tier_lc nx_tier_score fx_from_frac nx_tier_gain

structs

none

consts

24const NX_SEARCH_PORT: i64 = 8787

functions

27func bputc(buf: *u8, pos: *i64, cap: i64, c: i64) -> i64
31func bput(buf: *u8, pos: *i64, cap: i64, s: *u8) -> i64
called by 1: main calls 2: nx_str_lenbputc
37func bput_i64(buf: *u8, pos: *i64, cap: i64, n: i64) -> i64
called by 2: bput_q16main calls 1: bputc
47func bput_q16(buf: *u8, pos: *i64, cap: i64, x: i64) -> i64
calls 2: bput_i64bputc
61func nx_facet_name(f: i64) -> *u8
called by 1: main
71func nx_tier_name(t: i64) -> *u8
called by 1: main
81func nx_hexval(c: i64) -> i64
called by 1: nx_extract_query
90func nx_extract_query(req: *u8, path_off: i64, path_len: i64, out: *u8, out_cap: i64) -> i64
called by 1: main calls 1: nx_hexval
133func nx_split_terms(qbuf: *u8, qlen: i64, term_ptrs: **u8, term_lens: *i64, max: i64) -> i64
called by 1: main
155func main() -> i64