-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 7.4
-
Component/s: None
-
Labels:None
-
Lucene Fields:New
public void setMaxDocFreqPct(int maxPercentage) { this.maxDocFreq = maxPercentage * ir.numDocs() / 100; }
The above overflows integer range into negative numbers on even fairly small indexes (for maxPercentage = 75, it happens for just over 28 million documents.
We should make the computations on long range so that it doesn't overflow and have a more strict argument validation.
- is related to
-
LUCENE-8333 Switch MoreLikeThis.setMaxDocFreqPct to use maxDoc instead of numDocs
-
- Closed
-