apache / apache/lucene

Bound values of boosts [LUCENE-8016]

Open
#9,064 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-fix-version:8.1 legacy-jira-priority:Minor type:task
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

We allow any boosts to be passed down to similarities, eg. via `BoostQuery`. This is a bit trappy since it means that you can make scores rounded down to 0 and/or slow to compute (because of subnormal floats) by using tiny boosts, or infinite scores if you pass boosts that are too close to the float max value.

I would like to restrict boosts to be either +0 or between 2 -10 and 2 10 .

Any objections?

---
Migrated from [LUCENE-8016](https://issues.apache.org/jira/browse/LUCENE-8016) by Adrien Grand (@jpountz), updated Dec 08 2021

Contributor guide

Open the contributing guide

Research direction

Start by tracing how BoostQuery values are passed to similarities and identify the relevant scoring entry points. Confirm how +0, values outside 2^-10 to 2^10, and values near the float maximum are handled; done means boosts are restricted to the stated safe range.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.