BlendedInfixSuggester incorrectly scores items with high and low weights [LUCENE-10156]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
After fix #9390 BlendedInfixSuggester applies additional 1 / LINEAR_COEF coefficient for the weight that falls to (-10, 10) range. Where LINEAR_COEF = 0.1
Link to the changes: [Code](https://github.com/apache/lucene/commit/e0232f104509f28126d9ce060663f87508366338)
Whilst it fixes zero score issues, it causes incorrect scoring between item with weight <10 and item with weight > 10.
**Example:**
Blender - POSITION_RECIPROCAL (weight / (1 + position))
|Item|Weight|Score|
|-|-|-|
|AAA|8|8 \* (1 / 0.1) \* (1 / (1 + 0)) = 80|
|AAB|11|11 \* (1 / (1 + 0)) = 11|
So item AAA with lower weight bubbled up, but in fact, AAA must be on the bottom.
---
Migrated from [LUCENE-10156](https://issues.apache.org/jira/browse/LUCENE-10156) by Aleksandr Popitich
Linked issues:
- #9390
Contributor guide
Research direction
Start with the BlendedInfixSuggester scoring behavior described in this issue and compare it with the changes in commit e0232f104509f28126d9ce060663f87508366338 and issue #9390. Reproduce the AAA/AAB example, then identify the relevant Lucene test or entry point for blended scoring. Done means lower-weight items no longer outrank higher-weight items solely because of the coefficient.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100