code wiki / (root) / nx_dms_search.nx

nx_dms_search.nx

buildroot/runtime/nx_dms_search.nx

5537 B161 linesdepth 4pulls 8 transitivereach 3 importersview sourcekind librarytopic dms
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_rights_ledger.nx nx_dms_catalog.nx nx_bm25.nx nx_search_inverted.nx nx_dms_search.nx nx_dms_search_gate.nx nx_dms_search_store.nx nx_dms_search_store_gate.nx

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

24struct NxDmsSearchDoc
30struct NxDmsSearchIndex

consts

36const NX_DMS_SDOC_BYTES: nx_size = 24 // 3 fields * 8 bytes

functions

38func _sx_strlen(s: *u8) -> i64
44func nx_dms_search_new(capacity: nx_size) -> *NxDmsSearchIndex
called by 3: mainnx_dms_search_loadmain calls 1: sys_mmap
52func _sx_at(sx: *NxDmsSearchIndex, idx: nx_size) -> *NxDmsSearchDoc
57func nx_dms_search_add(sx: *NxDmsSearchIndex, asset_id: nx_int, text: *u8) -> nx_int
71func nx_dms_search_query(sx: *NxDmsSearchIndex, cat: *NxDmsCatalog, rl: *NxRightsLedger,
159func nx_dms_search_count(sx: *NxDmsSearchIndex) -> nx_size
called by 1: main