Similarities should round the length up [LUCENE-8053]
Open
legacy-jira-priority:Minor
type:bug
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
The encoding that we use for lengths currently rounds down in case the length cannot be stored accurately. We should round up instead so that frequencies can never be larger than the length.
---
Migrated from [LUCENE-8053](https://issues.apache.org/jira/browse/LUCENE-8053) by Adrien Grand (@jpountz)
Contributor guide
Research direction
Start by locating the Similarities length-encoding implementation and its existing tests. Trace how an inexact length is encoded, then verify with focused tests that rounding is upward and frequencies never exceed the encoded length.
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
- 45/100