Repository navigation
Conversation
…filter (#932) A `fields` clause was silently dropped from every hit whenever the same request carried an explicit `_source` includes list that did not contain the requested field. `{"_source": ["title"], "fields": ["body"]}` returned HTTP 200 with no `fields` block at all — for text and keyword fields alike — while the identical clause worked with no `_source` filter and with `_source: false`. Root cause: the engine narrows `hit.source` for an explicit SourceFilter::Includes/Fields BEFORE the response layer runs (xerj-engine/src/index.rs apply_source_filter), and the per-hit `fields` / `docvalue_fields` builders resolve every value out of that already-narrowed source (es_compat.rs:12670+ get_source_value_by_path(&h.source, ...)). An unresolvable `fields` entry is legally omitted, so the caller got the accepted-and-ignored shape of #204: 200, no warning, nothing. The #310 pierce covers only the DEFAULT projection — it is keyed on `body.source.is_none()` and companion-gated, so any explicit `_source` clause (including the `?_source=` / `?_source_includes=` URL spellings promoted into body.source) never pierced. Fix — the #310 approach applied to the explicit-filter path, entirely in search_impl (no engine change): - value_bearing_names is now computed for BOTH projections (es_compat.rs:11266). - New source_filter_drops_a_name (es_compat.rs:6110) decides coverage by running the production projection (xerj_engine::filter_object, already pub) over probe documents in both spellings the fields builder resolves (whole dotted path as a literal key, and the nested walk); a wildcarded name counts as dropped (conservative — emission re-applies the filter verbatim, so an unnecessary pierce costs only the _savings note). - pierce_explicit_source (es_compat.rs:11320): when the caller's own includes/excludes drop a value-bearing name, search runs with SourceFilter::Enabled(true) — the shape `_source: false` already uses for exactly this resolution. Not companion-gated: the dropped field is the caller's own. A filter that covers every named field does not pierce at all, so those requests stay byte-identical, engine-side narrowing and _savings note included. - Emission site 1 (es_compat.rs:12503): the wire `_source` is re-narrowed with the caller's exact patterns after the sentinel strips, before the synthetic block — same filter_object, same input order the engine would have used. - Emission site 3, the scroll snapshot (es_compat.rs:12251): re-narrowed before the context is stored, preserving the collapse sentinels exactly as the engine's own Includes/Fields branches do (take/filter/reattach, #651), so scroll continuation pages neither leak the pierced field nor lose inner_hits. Known, deliberate trade: a PIERCED request loses its `_savings` note (Enabled(true) is not a measured shape) — the same trade #310's pierce makes; covered requests keep theirs. `_msearch` and `_async_search` render hits through their own minimal builders that never render a `fields` block at all, so the #932 interplay does not exist there (a pre-existing, separate gap). Test evidence: new fields_pierce_explicit_source_includes.rs (6 tests) fails 6/6 on main with the exact issue symptom (fields Null under explicit includes; savings note present on the pierced shape) and passes with this fix. Full xerj-api suite 638 passed / 0 failed; cargo clippy -D warnings clean; ES-YAML conformance 1371 passed / 0 failed / 3 skipped against a private-port server built from this branch.
Owner
Author
Amakurai
pushed a commit
to Amakurai/xerj
that referenced
this pull request
Sep 27, 2026
…, rc.78 queue The 2026-09-21 review of this file was stale within hours: xerj-org#950 closed 19:33, xerj-org#941 19:38, xerj-org#1015 20:49 (all 2026-09-21), xerj-org#874 2026-09-22, and the stage-1 gating trio xerj-org#937/xerj-org#938/xerj-org#939 closed the same evening — every one recorded here as open or "under way". This pass re-checks every status claim against live tracker state and rolls the file forward: - Next release: the two "in flight" items (xerj-org#1015, xerj-org#950) are closed with fixes on main riding to rc.78 — the section now records what actually landed since the rc.77 tag (xerj-org#1009, xerj-org#1017, xerj-org#1018, xerj-org#1020, xerj-org#1021, xerj-org#1023, xerj-org#1025, xerj-org#1026, xerj-org#1033, xerj-org#1034) with PR links, including xerj-org#874's budget met at ~3x margin (206 -> 64 kB per idle index) and discussion xerj-org#1012's email-labelling measurement (1.000 templated tier / 0.625 at 0.902 confidence on the hard tier — wrong-and-confident). - Open defects: now xerj-org#1031 and xerj-org#1032 only; xerj-org#1015/xerj-org#950 removed (closed); trackers sentence corrected (xerj-org#941, xerj-org#874 closed — only xerj-org#298 remains by design). - GA gate: "Close the CHANGELOG gap" marked closed 2026-09-26 (the rc.19-rc.70 backfill, PR xerj-org#1035); the record-complete note replaces the gap warning under "Shipping today". - Zero-token: stage-1 gating trio recorded as fixed (xerj-org#991, xerj-org#995, xerj-org#979) with the old measured costs kept as the before-state; the xerj-org#940 hash-seed spread annotated as a pre-fix measurement; stage-2 object storage marked done (xerj-org#965 wired in rc.77 — the old bullet contradicted this file's own "Shipping today" section); mail ingest "unreleased" corrected to "shipped in rc.75"; three stale "In flight:" labels on landed stage-1 items relabelled "History:". - Mail-ingest memory line: xerj-org#948's runaway is fixed (xerj-org#1002) — the line now carries the fixed numbers and points at xerj-org#1032 for the residual. Review line updated to 2026-09-26 (machine-checked format), scoped honestly as a desk review. The milestones line is true again: rc.78 milestone created, all four open issues triaged (xerj-org#1030/xerj-org#1031/xerj-org#1032 -> rc.78, xerj-org#298 -> GA).
This was referenced Sep 30, 2026
neoneye
pushed a commit
to agent-memory-atlas-archive/xerj-org--xerj
that referenced
this pull request
Oct 1, 2026
…FAIL), BM25 +0.0160/+0.0179 (PASS) Motivation: issue xerj-org#1059 (rc.79) ships stemming-by-default via PR xerj-org#1070 and binds a release gate: "NFCorpus zero-hit queries 25 -> <=10; BEIR BM25 >= +0.01 over 0.657 SciFact / 0.302 NFCorpus." PR xerj-org#1070 measured nothing on the BEIR arms (its motivation figure is the published docs/ZERO_TOKEN_DIRECTION.md number); this is that measurement, on the release binary. Method: release binary (version string "xerj v1.0.0-rc.78", main @ a179e1e, which includes the xerj-org#1070 merge), one node on private port 9620, --insecure --embed-mode lexical, throwaway data dir. BEIR SciFact + NFCorpus downloaded from the URLs this README already uses (sha256s in run-meta.txt). Four indexes on one node — {scifact,nfcorpus} x {std,stem} — differing only in the create-time PUT: the stem arm declares settings.analysis.analyzer.default {"type":"stemmer"} (the exact xerj-org#1070/xerj-org#991 surface, added to the load step by load_stem.py exactly as xerj-org#1070's PR body anticipated); the std arm is the plain rc.74 baseline path. eval_bm25.py replays eval.py's bm25 arm verbatim (default-OR multi_match on title+text, size=100, graded nDCG@10) and writes one raw line per test query. Numbers (paired, same binary/node/datasets): - std arm reproduces the rc.74 published row EXACTLY: SciFact 0.6572 (300 q), NFCorpus 0.3016 (323 q), zero-hit 25 — same 25 qids as the committed results/nfcorpus-lexical-gap.txt list. - stem arm: SciFact 0.6732 (+0.0160), NFCorpus 0.3195 (+0.0179) — both clear +0.01: sub-gate B PASS. - NFCorpus zero-hit 25 -> 15: sub-gate A FAIL (needed <=10). Stemming fixed exactly the 10 inflection-class queries (bagels, leeks, pineapples, turnips, whiting, deafness, antinutrients, airport scanners, canker sores, Alli); the remaining 15 are single words whose stem also occurs nowhere in the corpus (Fosamax, Zoloft, Mevacor, Splenda, eggnog, halibut, mesquite, okra, taro, amnesia, myelopathy, Peoria, Tufts, Yale, Czechoslovakia) — not bridgeable by any stemmer; recorded, not tuned. Caveats recorded in gate-summary.txt: GET _settings does not echo the analysis block and _analyze shows the standard token path even on the stem arm, while search provably honours the declared default (std "bagels" 0 hits / stem 1 hit) — an observed display gap; latencies are wall-clock on a shared 32-core sandbox and are not gate inputs. File pointers: benchmarks/beir-hybrid/{load_stem.py,eval_bm25.py}, results/2026-09-30-stemming-1059/{gate-summary.txt,run-meta.txt, <ds>-<arm>-bm25.tsv x4, <ds>-<arm>-summary.txt x4}, README.md stem-gate section.
6 of 7 tasks
thomas-villani
added a commit
to thomas-villani/xerj
that referenced
this pull request
Oct 9, 2026
…stop documenting them as working The accepted-and-ignored class (xerj-org#204), continued on the convention `[merge]` (xerj-org#207) and `[compression]` (xerj-org#318) set: thirteen more keys were accepted, validated where they have a range, documented as working, and read by nothing, with no startup warning. - fts.default_analyzer: a text field uses its own analyzer, else the index's analysis.analyzer.default (xerj-org#991), else standard. - vector.default_metric: similarity comes from the mapping, cosine when omitted. - vector.hnsw_m / hnsw_ef_construction / hnsw_ef_search: the graph builds with fixed M=16 / ef_construction=200 (HnswParams::new); the beam width is the request's num_candidates. - vector.default_quantization: only the `binary` refusal reads it. - vector.max_dimensions: validated >= 1, never checked against anything. - logs.retention_days / time_partition: xerj-logs is a dependency but nothing outside the crate uses it; no retention job runs, while four pages promised deletion after 90 days (one as the ILM replacement). - indexing.turbo_batch_size / turbo_parallel / turbo_fast_analyzer: one batch per turbo request; parallel is a no-op since M5.9; fast_analyzer reaches an unused parameter. - storage.local_cache_dir: dormant since xerj-org#965 per its rustdoc, but not in any dormant_overrides. Each gets a DORMANT rustdoc note and a dormant_overrides() entry; Config::dormant_overrides() collects every section and main.rs WARNs through one loop (which previously covered merge and compression). That loop also had to move. It ran inside load_config(), which main() calls before init_tracing() so that [logging] governs the first line, so every warning was emitted with no subscriber and dropped: xerj-org#207's merge warning and xerj-org#318's compression warning have never printed. Measured on origin/main (e260e07, release build): [merge] io_rate_mb_per_sec = 50 boots with zero WARN lines. warn_dormant_overrides() now runs right after init_tracing() in both entry points (the server and `xerj index`). No hard errors: configs the project handed out must keep booting (xerj-org#207's rationale). Docs — xerj.default.toml, config.html, the log-analytics playbook, migration-from-es, analyzers, vectors, troubleshooting (which recommended the unread default_quantization as a RAM fix), engine/README — now say not wired. Evidence (agent-run): on v1.0.0-rc.89, fts.default_analyzer = "whitespace", vector.default_metric = "euclidean" and vector.max_dimensions = 4 changed nothing (match still hit "Foo-Bar"; kNN scored [1,0..] and [10,0..] both 1.0; 8-dim vectors indexed) with no warning. New test every_dormant_setting_is_named_only_when_an_operator_sets_it: each key named alone when set; nothing for the default or the shipped xerj.default.toml; wired neighbours never named. cargo test -p xerj-common --lib: 195 passed. On this branch's release build the same boot WARNs once per key set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A
fieldsclause was silently dropped from every hit whenever the same request carried an explicit_sourceincludes list that did not contain the requested field.{"_source": ["title"], "fields": ["body"]}returned HTTP 200 with nofieldsblock at all — for text and keyword fields alike — while the identical clause worked with no_sourcefilter and with_source: false. Because an unresolvablefieldsentry is legally omitted, callers got the accepted-and-ignored class of failure (#204): a 200, no warning, nothing. This is the sibling of #310, which fixed the same symptom for the default_sourceprojection; the explicit-includes path was not covered.Root cause
The engine narrows
hit.sourcefor an explicitSourceFilter::Includes/Fieldsbefore the response layer runs (apply_source_filter,engine/crates/xerj-engine/src/index.rs), and the per-hitfields/docvalue_fieldsbuilders resolve every value out of that already-narrowed source (get_source_value_by_path(&h.source, …)insearch_impl). The #310 pierce cannot fire here: it is keyed onbody.source.is_none()and companion-gated, so any explicit_sourceclause — including the?_source=and?_source_includes=URL spellings promoted intobody.source— kept the narrowed source and lost the named field.Elasticsearch treats the two clauses as independent:
fieldsreads the stored_sourceand parses/formats it via the mappings, while source filtering only selects "what fields of the source are returned" (docs/reference/elasticsearch/rest-apis/retrieve-selected-fields.md).Fix
The #310 approach applied to the explicit-filter path, entirely inside
search_implinengine/crates/xerj-api/src/es_compat.rs— no engine change:value_bearing_namesis now comp 8000 uted for both projections (es_compat.rs:11266).source_filter_drops_a_name(es_compat.rs:6110) decides coverage by running the production projection (xerj_engine::filter_object, alreadypub) over probe documents in both spellings the fields builder resolves — the whole dotted path as a literal key, and the nested walk. A wildcarded name counts as dropped (conservative direction: emission re-applies the filter verbatim, so an unnecessary pierce costs only the_savingsnote, a missed one is the silent 200 of this issue).pierce_explicit_source(es_compat.rs:11320): when the caller's own includes/excludes drop a value-bearing name, the search runs withSourceFilter::Enabled(true)— the same shape"_source": falsealready uses for exactly this resolution. Unlike fields API silently omits embedding companions under the new default_source(follow-up to #309) #310 it is not companion-gated: the dropped field is the caller's own, text or keyword alike. A filter that already covers every named field does not pierce at all, so those requests stay byte-identical, engine-side narrowing and_savingsnote included.es_compat.rs:12503): the wire_sourceis re-narrowed with the caller's exact patterns after the sentinel strips and before the synthetic block — samefilter_object, same input the engine would have filtered.es_compat.rs:12251): re-narrowed before the scroll context is stored, preserving the collapse sentinels exactly as the engine's own Includes/Fields branches do (take → filter → reattach, collapse: an explicit _source.includes that omits the collapse sentinel drops the leader's inner_hits #651), so continuation pages neither leak the pierced field nor loseinner_hits.Deliberate trade (same one #310's pierce makes, now pinned by a test): a pierced request loses its
_savingsnote becauseEnabled(true)is not a measured engine shape; covered requests keep theirs._msearchand_async_searchrender hits through their own minimal builders that never render afieldsblock at all, so this interplay does not exist there — a pre-existing, separate gap.Evidence
New integration test
engine/crates/xerj-api/tests/fields_pierce_explicit_source_includes.rs(6 tests, every assertion paired positive/negative):hits.hits.N.fields.body=nullunder_source: ["title"], and the would-be-pierced request still carried a_savingsnote (no pierce existed).catrow), the object spelling_source: {"includes": […]}, the URL spellings?_source_includes=titleand?_source=title&fields=body,docvalue_fields, an excludes-only filter, scroll continuation pages, and the_savings-note oracle proving covered names do not pierce while pierced ones trade the note.xerj-apicrate suite: 638 passed / 0 failed (includes the existing gatesfields_pierce_default_source,collapse_inner_hits_under_source_includes,savings_stat_is_honest,rerank_stage_http, and the scroll-suppression suites).cargo clippy --profile ci-test -p xerj-api -- -D warnings: clean.Fixes #932