nx_dms_search.nx
buildroot/runtime/nx_dms_search.nx
about
nx_dms_search.nx -- consent-gated search over the licensed library (DMS rung 4).
Ranks media by relevance to a text query using the existing nx_bm25 scorer,
but the candidate set is FIRST filtered through nx_dms_is_visible -- so a
search returns ONLY currently-licensed, active assets, ranked. An unlicensed
asset that is a STRONGER textual match is still never surfaced; revoke or
expire a license and it drops out of results the same instant.
Composes: nx_dms_catalog (visibility gate) + nx_rights_ledger (consent) +
nx_bm25 (ranking) + nx_search_inverted (tokenizer). DRY #15 -- no new
ranker, no new tokenizer.
RUNG 1 (this file): in-memory, BM25 over the visible candidate set. Scaling
to a persistent inverted index over the whole catalog (nx_search_inverted +
nx_seg_store) = later rung (flagged, NOT a silent cap).
license_tier: ORIGINAL
dependencies 5 imports · 3 importers
imports: nx_syscalls.nxnx_rights_ledger.nxnx_dms_catalog.nxnx_bm25.nxnx_search_inverted.nx
imported by: nx_dms_search_gate.nxnx_dms_search_store.nxnx_dms_search_store_gate.nx
structs
| 24 | struct NxDmsSearchDoc |
| 30 | struct NxDmsSearchIndex |
consts
| 36 | const NX_DMS_SDOC_BYTES: nx_size = 24 // 3 fields * 8 bytes |
functions
| 38 | func _sx_strlen(s: *u8) -> i64 |
| 44 | func nx_dms_search_new(capacity: nx_size) -> *NxDmsSearchIndex |
| 52 | func _sx_at(sx: *NxDmsSearchIndex, idx: nx_size) -> *NxDmsSearchDoc |
| 57 | func nx_dms_search_add(sx: *NxDmsSearchIndex, asset_id: nx_int, text: *u8) -> nx_int |
| 71 | func nx_dms_search_query(sx: *NxDmsSearchIndex, cat: *NxDmsCatalog, rl: *NxRightsLedger, called by 2: mainmain calls 6: sys_mmap_sx_atnx_dms_is_visible_sx_strlennx_inv_is_token_charnx_bm25_score |
| 159 | func nx_dms_search_count(sx: *NxDmsSearchIndex) -> nx_size called by 1: main |