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(rank_feature): assert f32 _score with close_to tolerance

xerj-org9f6166cdc076
diff --git a/engine/tests/es-compat-yaml/yaml/search/255_rank_feature.yml b/engine/tests/es-compat-yaml/yaml/search/255_rank_feature.yml
index adac34570..d611c45c2 100644
--- a/engine/tests/es-compat-yaml/yaml/search/255_rank_feature.yml
+++ b/engine/tests/es-compat-yaml/yaml/search/255_rank_feature.yml
@@ -40,8 +40,9 @@ setup:
- match: { hits.hits.1._id: "4" }
- match: { hits.hits.2._id: "1" }
- match: { hits.hits.3._id: "3" }
- # S = 10 / (10 + 8) = 0.5555556 for doc 1.
- - match: { hits.hits.2._score: 0.5555556 }
+ # S = 10 / (10 + 8) = 0.5555556 for doc 1. Score is an f32 widened to f64
+ # on the wire, so assert with a tolerance (ES's own YAML uses close_to here).
+ - close_to: { hits.hits.2._score: { value: 0.5555556, error: 0.0001 } }
---
"rank_feature linear yields _score == value":