nx_lib_index.nx
buildroot/runtime/nx_lib_index.nx
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
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
| 10 | const LIBINDEX_MAGIC_1024: i64 = 1024 |
| 11 | const LIBINDEX_MAGIC_1048576: i64 = 1048576 |
| 12 | const LIBINDEX_MAGIC_16384: i64 = 16384 |
| 14 | const LIBINDEX_PATH: *u8 = "knowledge/libindex.nxinv" as *u8 |
functions
| 18 | func lidx_pass(ix: *NxInvIndex, idxbuf: *u8, inn: i64, emit: i64, h: *i64, kbuf: *u8) -> i64 |
| 52 | func nx_lib_index_build() -> i64 |
| 70 | func nx_lib_index_search(query: *u8, qn: i64, out: *u8) -> i64 |