Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

test(autoindex): update clustering-key test for #170's const capture

xerj-org48ac83ab69af
diff --git a/engine/crates/xerj-autoindex/src/lib.rs b/engine/crates/xerj-autoindex/src/lib.rs
index 1c5b97d84..da8614e6f 100644
--- a/engine/crates/xerj-autoindex/src/lib.rs
+++ b/engine/crates/xerj-autoindex/src/lib.rs
@@ -319,8 +319,11 @@ mod clustering_key_tests {
let dir = std::env::temp_dir().join("xerj-ax-178-key");
std::fs::create_dir_all(&dir).unwrap();
- // `const` is invisible to the shipped Rust query, so this file parses
- // to zero symbols — exactly the case #170 improves.
+ // #170 now captures the `const`, so this file parses to one symbol and
+ // GAINS a `defs` field — the case #170 improves. The point of this test
+ // survives that change: the newly-captured extractor name must still be
+ // kept out of the clustering key (#180), so a const-only file and a
+ // fn/struct file still land in ONE dataset rather than re-homing apart.
let table = scan(
&dir,
"table.rs",
@@ -337,7 +340,8 @@ mod clustering_key_tests {
s.sketches[0].key_fields
);
}
- assert!(!table.sketches[0].fields.contains_key("defs"));
+ // #170: the const is now captured, so the table file has `defs` too.
+ assert!(table.sketches[0].fields.contains_key("defs"));
assert!(code.sketches[0].fields.contains_key("defs"));
// …so the two land in one dataset instead of one dataset each.