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

This commit is contained in:
Greg Miller 2021-11-29 18:00:52 -08:00
parent c5b5fd641b
commit 8a03d2ffc9

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