public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScoreFunctionBuilder>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
EMPTY_PARAMS
Constructor and Description |
---|
RandomScoreFunctionBuilder() |
RandomScoreFunctionBuilder(StreamInput in)
Read from a stream.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
doEquals(RandomScoreFunctionBuilder functionBuilder)
Check that two instances of the same subclass of ScoreFunctionBuilder are equal.
|
protected int |
doHashCode()
Hashcode for fields defined in this subclass of ScoreFunctionBuilder.
|
protected ScoreFunction |
doToFunction(QueryShardContext context)
Build the Lucene ScoreFunction for this builder.
|
protected void |
doWriteTo(StreamOutput out)
Write the subclass's components into the stream.
|
void |
doXContent(XContentBuilder builder,
ToXContent.Params params)
Convert this subclass's data into XContent.
|
static RandomScoreFunctionBuilder |
fromXContent(QueryParseContext parseContext) |
java.lang.String |
getName()
The name of this score function.
|
java.lang.Integer |
getSeed() |
RandomScoreFunctionBuilder |
seed(int seed)
Sets the seed based on which the random number will be generated.
|
RandomScoreFunctionBuilder |
seed(long seed)
seed variant taking a long value.
|
RandomScoreFunctionBuilder |
seed(java.lang.String seed)
seed variant taking a String value.
|
equals, getWeight, getWriteableName, hashCode, setWeight, toFunction, toXContent, writeTo
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFragment
public static final java.lang.String NAME
public RandomScoreFunctionBuilder()
public RandomScoreFunctionBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
ScoreFunctionBuilder
doWriteTo
in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>
java.io.IOException
public java.lang.String getName()
ScoreFunctionBuilder
getName
in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>
public RandomScoreFunctionBuilder seed(int seed)
seed
- The seed.public RandomScoreFunctionBuilder seed(long seed)
seed(int)
public RandomScoreFunctionBuilder seed(java.lang.String seed)
seed(int)
public java.lang.Integer getSeed()
public void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
ScoreFunctionBuilder
doXContent
in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>
java.io.IOException
protected boolean doEquals(RandomScoreFunctionBuilder functionBuilder)
ScoreFunctionBuilder
doEquals
in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>
protected int doHashCode()
ScoreFunctionBuilder
doHashCode
in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>
protected ScoreFunction doToFunction(QueryShardContext context)
ScoreFunctionBuilder
doToFunction
in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>
public static RandomScoreFunctionBuilder fromXContent(QueryParseContext parseContext) throws java.io.IOException, ParsingException
java.io.IOException
ParsingException