code wiki / (root) / nx_facet_filter.nx

nx_facet_filter.nx

buildroot/runtime/nx_facet_filter.nx

6065 B117 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_facet_filter.nx -- FACETED SEARCH for the onsite-search arc (closes its "facet" worklist gap). The post-ranking faceting layer: given BM25-ranked hit doc-ids + a per-doc Dublin-Core facet schema (subject / type / creator / date -- dc:subject, dc:type, dc:creator, dc:date), (1) FILTER the hits by selected facet values (AND across facets) and (2) return per-facet-value COUNTS (the facet UI: "Subject: law (4), ..."). Research-driven: faceted search (the feature) + Dublin Core DCMI Terms (the facet vocabulary), both sovereign-fetched + cited (ledger #24). Integer facet-value ids (strings interned upstream). Reusable: wire the BM25 hits from nx_onsite_search into ff_filter/ff_count. Sovereign (nx_cc->nxasm). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_facet_filter.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap ff_puts sys_write ff_count ff_putn sys_write ↻ sys_mmap ↻ ff_filter sys_exit

structs

none

consts

10const FF_NDOCS: i64 = 12
11const FF_NFACET: i64 = 4 // DC facets: 0=subject 1=type 2=creator 3=date
12const FF_NOSEL: i64 = 0 - 1 // sentinel: facet not selected (no filter on it)

functions

14func ff_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
15func ff_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
28func ff_filter(hits: *i64, n: i64, vals: *i64, sel: *i64, out: *i64) -> i64
called by 1: main
46func ff_count(hits: *i64, n: i64, vals: *i64, f: i64, counts: *i64) -> i64
called by 1: main
52func main() -> i64