public class RandomScoreFunction extends ScoreFunction
LeafScoreFunction.score(int, float)
.Constructor and Description |
---|
RandomScoreFunction()
Default constructor.
|
RandomScoreFunction(int seed,
int salt,
IndexFieldData<?> uidFieldData)
Creates a RandomScoreFunction.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
doEquals(ScoreFunction other)
Indicates whether some other
ScoreFunction object of the same type is "equal to" this one. |
protected int |
doHashCode() |
LeafScoreFunction |
getLeafScoreFunction(org.apache.lucene.index.LeafReaderContext ctx) |
boolean |
needsScores()
Indicates if document scores are needed by this function.
|
equals, getDefaultScoreCombiner, hashCode
public RandomScoreFunction()
public RandomScoreFunction(int seed, int salt, IndexFieldData<?> uidFieldData)
seed
- A seed for randomnesssalt
- A value to salt the seed with, ideally unique to the running node/indexuidFieldData
- The field data for _uid to use for generating consistent random values for the same idpublic LeafScoreFunction getLeafScoreFunction(org.apache.lucene.index.LeafReaderContext ctx)
getLeafScoreFunction
in class ScoreFunction
public boolean needsScores()
ScoreFunction
needsScores
in class ScoreFunction
true
if scores are needed.protected boolean doEquals(ScoreFunction other)
ScoreFunction
ScoreFunction
object of the same type is "equal to" this one.doEquals
in class ScoreFunction
protected int doHashCode()
doHashCode
in class ScoreFunction