LUCENE-8333: Switch MoreLikeThis.setMaxDocFreqPct to use maxDoc instead of numDoc

This commit is contained in:
Dawid Weiss 2018-05-25 12:22:21 +02:00
parent 719fce8026
commit 7a5d9ca5e8
2 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,9 @@ API Changes
Changes in Runtime Behavior
* LUCENE-8333: Switch MoreLikeThis.setMaxDocFreqPct to use maxDoc instead of
numDocs. (Robert Muir, Dawid Weiss).
* LUCENE-7837: Indices that were created before the previous major version
will now fail to open even if they have been merged with the previous major
version. (Adrien Grand)

View File

@ -425,7 +425,7 @@ public final class MoreLikeThis {
* in to be still considered relevant.
*/
public void setMaxDocFreqPct(int maxPercentage) {
setMaxDocFreq(Math.toIntExact((long) maxPercentage * ir.numDocs() / 100));
setMaxDocFreq(Math.toIntExact((long) maxPercentage * ir.maxDoc() / 100));
}
/**