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.

polish(rustdoc): ManagedSchema::is_compatible_with allows fields missing from `other` (#1572)

xerj-org86aaaeb0e020
diff --git a/engine/crates/xerj-common/src/schema.rs b/engine/crates/xerj-common/src/schema.rs
index 5e0dc1cd5..6e2948735 100644
--- a/engine/crates/xerj-common/src/schema.rs
+++ b/engine/crates/xerj-common/src/schema.rs
@@ -179,9 +179,9 @@ impl ManagedSchema {
/// Check whether `other` is compatible with `self` for a schema upgrade.
///
- /// Compatible means: every field in `self` also exists in `other` with the
- /// same type. `other` may have additional fields. Changing a field's type
- /// is never compatible.
+ /// Compatible means: every field present in both `self` and `other` has
+ /// the same type. Either side may have fields the other lacks (schemas
+ /// grow additively). Changing a field's type is never compatible.
pub fn is_compatible_with(&self, other: &ManagedSchema) -> Result<(), XerjError> {
for field in &self.schema.fields {
// A field missing from `other` is fine — schemas grow additively,