code wiki / _hdl_build / nx_search_federated.nx

nx_search_federated.nx

buildroot/runtime/_hdl_build/nx_search_federated.nx

7447 B149 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tooltopic search
docsdependenciesstructsconstsfunctions

about

nx_search_federated.nx -- FEDERATED QUERY across every Nishi index, driven by the search-sources MANIFEST. This is the integration CONSUMER: it reads knowledge/index/search_sources.txt (the contract written by nx_search_register) and queries EVERY listed index -- the ecosystem library index AND the researcher's growing shards AND any future index -- through one interface. It has NO hardcoded index paths and NO knowledge of "researcher" vs "library": it just queries whatever the manifest lists. Adding a new index source needs ZERO change here = loose coupling. Merges candidates across sources, ranks by #query-terms-matched, prints top-K `score [label] path`. Usage: nx_search_federated <term> [term ...] expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_search_inverted_persist.nx nx_search_federated.nx

imports: nx_search_inverted_persist.nx

imported by: nobody (leaf or entry point)

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

main fs_puts sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close fs_scan nx_inv_load sys_read_file ↻ fs_load_docmap sys_read_file ↻ nx_inv_query_term nx_inv_hash_bytes_lower nx_inv_lookup_slot nx_inv_slot_at nx_inv_slot_hash nx_inv_slot_postings_count nx_inv_slot_postings_offse nx_inv_slot_write_cursor fs_strlen fs_num

structs

none

consts

10const FS_TERMS: i64 = 8
11const FS_ROWIDS: i64 = 4096
12const FS_CAND: i64 = 32768
13const FS_TOPK: i64 = 15
14const FS_SRC: i64 = 8192

functions

16func fs_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
17func fs_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main
18func fs_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
21func fs_scan(buf: *u8, i: i64, end: i64) -> i64
called by 1: main
28func fs_load_docmap(path: *u8, paths_out: *i64, cap: i64) -> i64
called by 1: main calls 1: sys_read_file
45func main(argc: i64, argv: *i64) -> i64