nx_wiki_search_wiring.nx
buildroot/runtime/wiki/nx_wiki_search_wiring.nx
about
nx_wiki_search_wiring.nx -- WIKI-SPECIFIC THIN WIRING for search.
All search logic lives in HUB primitives; this file is glue:
1. Extract query string from URL (after '?')
2. Run the hub flow with wiki-specific theme
3. Resolve each result rowid via wiki doc store
4. HTTP-wrap with /wiki/search-style 200 response
Per operator cardinal 2026-05-27: "make sure you make the onsite and
offsite search reusable and not just tied to the wiki" -- this file
is structurally enforced THIN per NISHI_SMALL_SHARP_COMPOSABLE_STANDARD
ยง4.1 M3 + the hub<->site separation in nx_search_handler_flow.
COMPOSES (only hub + wiki primitives):
hub/nx_search_handler_flow (5-step pipeline)
hub/nx_search_render_html (theme + inputs structs)
hub/nx_search_query_parser (NxSearchQuery accessors)
nx_search_onsite_engine (NxSearchResults accessors)
nx_search_inverted (NxInvIndex)
wiki/nx_wiki_search_render (theme constants)
COMPOSED BY:
wiki/nx_wiki_routes (dispatches /wiki/search here)
dependencies 9 imports · 1 importers
imports: nx_syscalls.nxnx_search_handler_flow.nxnx_search_render_html.nxnx_search_query_parser.nxnx_search_onsite_engine.nxnx_search_inverted.nxnx_wiki_search_render.nxnx_wiki_index_builder.nxnx_wiki_bm25_search.nx
imported by: nx_wiki_routes.nx
structs
| none |
consts
| 36 | const NX_WSW_OK: i64 = 0 |
| 37 | const NX_WSW_BAD_INPUT: i64 = 2200 |
| 38 | const NX_WSW_QUERY_TOO_LONG: i64 = 2201 |
| 39 | const NX_WSW_RESOLVER_OVERFLOW: i64 = 2202 |
| 40 | const NX_WSW_FLOW_FAIL: i64 = 2203 |
| 43 | const NX_WSW_MAX_URL_LEN: i64 = 4096 |
| 44 | const NX_WSW_RESOLVER_BUF_CAP: i64 = 16384 // 16 KB scratch for resolved doc data |
| 45 | const NX_WSW_PLACEHOLDER_TITLE_CAP: i64 = 64 |
| 46 | const NX_WSW_PLACEHOLDER_URL_CAP: i64 = 128 |
| 47 | const NX_WSW_PLACEHOLDER_BODY_CAP: i64 = 512 |
| 48 | const NX_WSW_RANK_CAP: i64 = 256 // BM25 ranked-result scratch cap |
| 49 | const NX_WSW_RENDER_CAP: i64 = 200 // hub render hard cap (NX_SRH_MAX_RESULTS_RENDER) |
functions
| 67 | func nx_wsw_resolve_docs_placeholder(flow: *NxSearchFlow, |
| 118 | func nx_wsw_resolve_docs_from_store(flow: *NxSearchFlow, |
| 169 | func nx_wsw_extract_query_string(url: *u8, url_n: i64, |
| 196 | func nx_wiki_search_handle_v2(flow: *NxSearchFlow, |
| 262 | func nx_wiki_search_handle(flow: *NxSearchFlow, calls 1: nx_wiki_search_handle_v2 |
| 292 | func nx_wiki_search_handle_bm25(flow: *NxSearchFlow, |
| 417 | func nx_wiki_search_handle_legacy(flow: *NxSearchFlow, |