FastVectorHighlighter loses boost values in phrase expansion and nested queries
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
### Description
FastVectorHighlighter incorrectly handles boost values in two scenarios:
1. **Phrase Expansion**: When overlapping phrases with different boosts expand, the expanded phrase loses original boost values and defaults to 1.0
2. **Nested Boosts**: Nested BoostQuery objects only preserve the outermost boost value, shouldn't we preserve max of them
## Impact
- Critical content gets weak highlighting despite high boost values
- Search result emphasis doesn't reflect query importance
- Breaks boost value semantics in search applications
## Example
**Scenario**: Legal document search where "contract termination" (boost: 10.0) and "termination clause" (boost: 5.0) should highlight "contract termination clause" prominently.
**Current Result**: "contract termination clause" gets boost 1.0 → weak highlighting
**Expected Result**: "contract termination clause" should get meaningful boost value → appropriate highlighting
### Version and environment details
- Lucene main branch
- Component: `lucene/highlighter` (FastVectorHighlighter)
- Likely affected code: `FieldQuery.java` phrase expansion logic
Contributor guide
Research direction
Start with the phrase expansion logic in lucene/highlighter's FieldQuery.java and trace how FastVectorHighlighter handles overlapping phrases and nested BoostQuery objects. Reproduce the two described scenarios, then verify that expanded phrases retain meaningful original boosts and nested boosts preserve the maximum value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100