[test] Cover boost-config + facet drill-down in the ft:highlight regression#6486
Merged
line-o merged 1 commit intoJun 17, 2026
Merged
Conversation
…ion test Follow-up to eXist-db#6454, which fixed ft:highlight-field-matches under facet drill-down (DrillDownQuery.getBaseQuery() plus a FunctionScoreQuery unwrap in LuceneUtil.extractTerms). The FunctionScoreQuery branch specifically handles the boost-config + facet combination, where the query stored on the match is FunctionScoreQuery(DrillDownQuery(content)) and DrillDownQuery.visit() is an opaque leaf. That path shipped without a test. Adds a second, boost-configured collection (boost="2.0" on the para field) to facet-drilldown-highlight.xqm plus two assertions: a faceted query still highlights, and the highlighted term is the queried term. Confirmed these fail without the FunctionScoreQuery unwrap and pass with it. Full lucene XQuery suite green (668 tests, 0 failures). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
duncdrum
approved these changes
Jun 16, 2026
line-o
approved these changes
Jun 17, 2026
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.
[This PR was co-authored with Claude Code. -Joe]
Summary
Test-only follow-up to #6454 (merged), which fixed
ft:highlight-field-matchesunder facet drill-down. That fix had two parts inLuceneUtil.extractTerms:extractTermsFromDrillDownnow usesDrillDownQuery.getBaseQuery()instead of rewriting, and a newFunctionScoreQuerycase unwrapsgetWrappedQuery()and recurses.The second part exists specifically for the boost-config + facet combination: when an index carries a boost, the query stored on each match is
FunctionScoreQuery(DrillDownQuery(content)), andDrillDownQuery.visit()is an opaquevisitLeaf— so without unwrapping theFunctionScoreQueryto reach the drill-down's base query, highlight extraction marks nothing. That path shipped in #6454 without a dedicated test; this PR adds one.What changed
extensions/indexes/lucene/src/test/xquery/lucene/facet-drilldown-highlight.xqm— adds a second, boost-configured collection (boost="2.0"on theparafield) and two assertions against it:No production code changes — the fix is already in
developvia #6454.Test plan
LuceneTests668 tests, 0 failures, 0 errors (36 pre-existing skips).FunctionScoreQueryunwrap is removed and pass with it — i.e. they genuinely guard that path, not just the already-covered plain-facet path.