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.

style(search): rustfmt the #940 fusion helpers and test

xerj-org4c0290d135a2
diff --git a/engine/crates/xerj-engine/src/index.rs b/engine/crates/xerj-engine/src/index.rs
index e0aadbbfd..e481e8c74 100644
--- a/engine/crates/xerj-engine/src/index.rs
+++ b/engine/crates/xerj-engine/src/index.rs
@@ -35984,11 +35984,7 @@ fn fuse_finish(mut entries: Vec<FusedEntry>) -> Vec<Hit> {
/// OpenSearch / TREC convention) and is small enough that the top
/// few ranks still dominate. Output is in THE FUSED ORDER (#940);
/// `seq_no_of` resolves a document's arrival `seq_no` for the tie-break.
-fn fuse_rrf(
- sub_results: &[(Vec<Hit>, f32)],
- k: u32,
- seq_no_of: &dyn Fn(&str) -> u64,
-) -> Vec<Hit> {
+fn fuse_rrf(sub_results: &[(Vec<Hit>, f32)], k: u32, seq_no_of: &dyn Fn(&str) -> u64) -> Vec<Hit> {
let kf = k as f32;
let mut entries: Vec<FusedEntry> = Vec::new();
let mut slot_by_id: HashMap<String, usize> = HashMap::new();
diff --git a/engine/crates/xerj-engine/tests/hybrid_fused_order_is_stable.rs b/engine/crates/xerj-engine/tests/hybrid_fused_order_is_stable.rs
index ad80de884..30d26ba14 100644
--- a/engine/crates/xerj-engine/tests/hybrid_fused_order_is_stable.rs
+++ b/engine/crates/xerj-engine/tests/hybrid_fused_order_is_stable.rs
@@ -101,7 +101,11 @@ async fn symmetric_corpus(idx: &Arc<Index>) -> HashMap<String, usize> {
.unwrap();
arrival.insert(id, pos);
}
- assert_eq!(arrival.len(), n, "the permutation must visit every document");
+ assert_eq!(
+ arrival.len(),
+ n,
+ "the permutation must visit every document"
+ );
arrival
}
@@ -204,7 +208,10 @@ async fn assert_fused_pages(label: &str, idx: &Arc<Index>, arrival: &HashMap<Str
walked.extend(page(idx, from, size, &rrf()).await);
from += size;
}
- assert_eq!(walked, full, "{label}: paging by {size} reorders the corpus");
+ assert_eq!(
+ walked, full,
+ "{label}: paging by {size} reorders the corpus"
+ );
}
// ── Linear ───────────────────────────────────────────────────────────