code wiki / (root) / nx_lib_index.nx

nx_lib_index.nx

buildroot/runtime/nx_lib_index.nx

5690 B142 linesdepth 5pulls 7 transitivereach 11 importersview sourcekind librarytopic lib
docsdependenciesstructsconstsfunctions

about

nx_lib_index.nx -- PERSISTED inverted index for the library search (the perf-EXCEED over the linear scan). Wires the ecosystem's sovereign engine nx_search_inverted(+_persist): build the index ONCE over the work titles (docid = __works__ line), save to disk; query is O(1) hash lookup per term (vs SQLite FTS5's B-tree AND the linear scan's O(n)). AND semantics: a work matches only if EVERY query term hits it. Uses nishi APIs, no new ranking. license_tier: ORIGINAL | genealogy_id: nishi_library_sovereign_index_2026_07_01

dependencies 2 imports · 6 importers

nx_lib_store.nx nx_search_inverted_persist.nx nx_lib_index.nx nx_lib_gbif_bulk.nx nx_lib_gbif_probe.nx nx_lib_http.nx nx_lib_index_test.nx nx_lib_openalex_probe.nx nx_lib_reindex.nx

imports: nx_lib_store.nxnx_search_inverted_persist.nx

imported by: nx_lib_gbif_bulk.nxnx_lib_gbif_probe.nxnx_lib_http.nxnx_lib_index_test.nxnx_lib_openalex_probe.nxnx_lib_reindex.nx

structs

none

consts

10const LIBINDEX_MAGIC_1024: i64 = 1024
11const LIBINDEX_MAGIC_1048576: i64 = 1048576
12const LIBINDEX_MAGIC_16384: i64 = 16384
14const LIBINDEX_PATH: *u8 = "knowledge/libindex.nxinv" as *u8

functions

18func lidx_pass(ix: *NxInvIndex, idxbuf: *u8, inn: i64, emit: i64, h: *i64, kbuf: *u8) -> i64
52func nx_lib_index_build() -> i64