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 |
---|---|
LeafScoreFunction |
getLeafScoreFunction(org.apache.lucene.index.LeafReaderContext ctx) |
boolean |
needsScores()
Indicates if document scores are needed by this function.
|
getDefaultScoreCombiner
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.Copyright © 2009–2016. All rights reserved.