Struct elasticsearch_dsl::search::queries::params::RandomScore [−][src]
pub struct RandomScore { /* fields omitted */ }
Expand description
The random_score
generates scores that are uniformly distributed from 0
up to but not
including 1
.
By default, it uses the internal Lucene doc ids as a source of randomness, which is very efficient but unfortunately not reproducible since documents might be renumbered by merges.
In case you want scores to be reproducible, it is possible to provide a seed
and field
. The
final score will then be computed based on this seed, the minimum value of field
for the
considered document and a salt that is computed based on the index name and shard id so that
documents that have the same value but are stored in different indexes get different scores.
Note that documents that are within the same shard and have the same value for field
will
however get the same score, so it is usually desirable to use a field that has unique values
for all documents. A good default choice might be to use the _seq_no
field, whose only
drawback is that scores will change if the document is updated since update operations also
update the value of the _seq_no
field.
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for RandomScore
impl Send for RandomScore
impl Sync for RandomScore
impl Unpin for RandomScore
impl UnwindSafe for RandomScore
Blanket Implementations
Mutably borrows from an owned value. Read more