Class RandomScoreFunctionBuilder

java.lang.Object
org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder<RandomScoreFunctionBuilder>
org.elasticsearch.index.query.functionscore.RandomScoreFunctionBuilder
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class RandomScoreFunctionBuilder
extends ScoreFunctionBuilder<RandomScoreFunctionBuilder>
A function that computes a random score for the matched documents
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String NAME  

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor Description
    RandomScoreFunctionBuilder()  
    RandomScoreFunctionBuilder​(StreamInput in)
    Read from a stream.
  • Method Summary

    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​(SearchExecutionContext context)
    Build the Lucene ScoreFunction for this builder.
    protected void doWriteTo​(StreamOutput out)
    Write the subclass's components into the stream.
    void doXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
    Convert this subclass's data into XContent.
    static RandomScoreFunctionBuilder fromXContent​(org.elasticsearch.common.xcontent.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.

    Methods inherited from class org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder

    equals, getWeight, getWriteableName, hashCode, setWeight, toFunction, toXContent, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment