Add javadoc note in DoubleValuesSource (see LUCENE-10258) (#490)

This commit is contained in:
Greg Miller 2021-11-29 18:00:52 -08:00 committed by GitHub
parent 453168ec76
commit 4f5b41a71c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -326,7 +326,13 @@ public abstract class DoubleValuesSource implements SegmentCacheable {
}
}
/** Returns a DoubleValues instance that wraps scores returned by a Scorer */
/**
* Returns a DoubleValues instance that wraps scores returned by a Scorer.
*
* <p>Note: If you intend to call {@link Scorable#score()} on the provided {@code scorer}
* separately, you may want to consider wrapping it with {@link
* ScoreCachingWrappingScorer#wrap(Scorable)} to avoid computing the actual score multiple times.
*/
public static DoubleValues fromScorer(Scorable scorer) {
return new DoubleValues() {
@Override