From f42938c5bd25baca9b39ff8b6cd29795969c5fdd Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 30 Oct 2018 12:18:53 -0400 Subject: [PATCH 1/2] Docs: Remove range notation from random score docs The `random_score` function produces values between 0 (inclusive) and 1 (exclusive) and documented it with fancy methematical range notation. It is so fancy I thought it was a typo. This changes the documentation to use words. Relates to #35084 --- docs/reference/query-dsl/function-score-query.asciidoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference/query-dsl/function-score-query.asciidoc b/docs/reference/query-dsl/function-score-query.asciidoc index 4b4a82594a110..85812aa704d34 100644 --- a/docs/reference/query-dsl/function-score-query.asciidoc +++ b/docs/reference/query-dsl/function-score-query.asciidoc @@ -208,10 +208,10 @@ not. The number value is of type float. [[function-random]] ==== Random -The `random_score` generates scores that are uniformly distributed in [0, 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. +The `random_score` generates scores that are uniformly distributed between 0 +(inclusive) and 1 (exclusive). 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 From 35a20529e9f37b726c9714cb9bd22f7f00bb8051 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 30 Oct 2018 12:30:19 -0400 Subject: [PATCH 2/2] better words --- docs/reference/query-dsl/function-score-query.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/query-dsl/function-score-query.asciidoc b/docs/reference/query-dsl/function-score-query.asciidoc index 85812aa704d34..7c5ca95623e83 100644 --- a/docs/reference/query-dsl/function-score-query.asciidoc +++ b/docs/reference/query-dsl/function-score-query.asciidoc @@ -208,9 +208,9 @@ not. The number value is of type float. [[function-random]] ==== Random -The `random_score` generates scores that are uniformly distributed between 0 -(inclusive) and 1 (exclusive). By default, it uses the internal Lucene doc ids -as a source of randomness, which is very efficient but unfortunately not +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`