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.

docs(query): match_phrase slop is in-order only, not transpositions (#830) (#831)

xerj-orga7ff4592aa30
diff --git a/engine/crates/xerj-query/src/ast.rs b/engine/crates/xerj-query/src/ast.rs
index 601df5474..e2ccc111f 100644
--- a/engine/crates/xerj-query/src/ast.rs
+++ b/engine/crates/xerj-query/src/ast.rs
@@ -413,7 +413,10 @@ pub enum QueryNode {
minimum_should_match: Option<MinShouldMatch>,
},
- /// Ordered phrase match with optional slop (token transpositions allowed).
+ /// Ordered phrase match with optional slop. `slop` admits forward gaps
+ /// between the in-order tokens ONLY — it does NOT admit transpositions
+ /// (reorderings), a known divergence from Lucene's SloppyPhraseMatcher
+ /// (see #830 and `index.rs::phrase_walk`).
MatchPhrase {
field: String,
query: String,
diff --git a/engine/crates/xerj-query/src/planner.rs b/engine/crates/xerj-query/src/planner.rs
index 567e6177f..f0a6f241d 100644
--- a/engine/crates/xerj-query/src/planner.rs
+++ b/engine/crates/xerj-query/src/planner.rs
@@ -62,7 +62,8 @@ pub enum ExecutionPlan {
field: String,
tokens: Vec<String>,
require_all: bool,
- /// Phrase mode — tokens must appear in order (with `slop` transpositions).
+ /// Phrase mode — tokens must appear IN ORDER, with `slop` forward gaps
+ /// permitted between them (NOT transpositions/reorderings; see #830).
phrase: bool,
slop: u32,
cost: f64,