Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
New
Description
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.
Attachments
Attachments
Issue Links
- is related to
-
LUCENE-8333 Switch MoreLikeThis.setMaxDocFreqPct to use maxDoc instead of numDocs
- Reopened