NamedWriteable, Writeable, ToXContent, ToXContentFragmentpublic class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScoreFunctionBuilder>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
NAME |
EMPTY_PARAMS| Constructor | Description |
|---|---|
RandomScoreFunctionBuilder() |
|
RandomScoreFunctionBuilder(StreamInput in) |
Read from a stream.
|
| Modifier and Type | Method | 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(XContentParser parser) |
|
java.lang.String |
getField() |
Get the field to use for random number generation.
|
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.
|
RandomScoreFunctionBuilder |
setField(java.lang.String field) |
Set the field to be used for random number generation.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitequals, getWeight, getWriteableName, hashCode, setWeight, toFunction, toXContent, writeToisFragmentpublic static final java.lang.String NAME
public RandomScoreFunctionBuilder()
public RandomScoreFunctionBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionprotected void doWriteTo(StreamOutput out) throws java.io.IOException
ScoreFunctionBuilderdoWriteTo in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>java.io.IOExceptionpublic java.lang.String getName()
ScoreFunctionBuildergetName 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 RandomScoreFunctionBuilder setField(java.lang.String field)
seed is set and ignored otherwise. Note that documents that
have the same value for a field will get the same score.public java.lang.String getField()
setField(String)public void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
ScoreFunctionBuilderdoXContent in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>java.io.IOExceptionprotected boolean doEquals(RandomScoreFunctionBuilder functionBuilder)
ScoreFunctionBuilderdoEquals in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>protected int doHashCode()
ScoreFunctionBuilderdoHashCode in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>protected ScoreFunction doToFunction(QueryShardContext context)
ScoreFunctionBuilderdoToFunction in class ScoreFunctionBuilder<RandomScoreFunctionBuilder>public static RandomScoreFunctionBuilder fromXContent(XContentParser parser) throws java.io.IOException, ParsingException
java.io.IOExceptionParsingException