From c2eb4a1c40f8eb9d90134fb1b5d1ef0c382d97de Mon Sep 17 00:00:00 2001 From: Clinton Gormley Date: Mon, 16 Sep 2013 15:56:57 +0200 Subject: [PATCH] [DOCS] Tidied up function score --- .../queries/function-score-query.asciidoc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/reference/query-dsl/queries/function-score-query.asciidoc b/docs/reference/query-dsl/queries/function-score-query.asciidoc index bddebd7d217..7779c9fe101 100644 --- a/docs/reference/query-dsl/queries/function-score-query.asciidoc +++ b/docs/reference/query-dsl/queries/function-score-query.asciidoc @@ -29,7 +29,7 @@ by the query. "(query|filter)": {}, "boost": "boost for the whole query", "FUNCTION": {}, - "boost_mode":"(mult|replace|...)" + "boost_mode":"(multiply|replace|...)" } -------------------------------------------------- @@ -52,8 +52,8 @@ given filter: } ], "max_boost": number, - "score_mode": "(mult|max|...)", - "boost_mode": "(mult|replace|...)" + "score_mode": "(multiply|max|...)", + "boost_mode": "(multiply|replace|...)" } -------------------------------------------------- @@ -78,6 +78,7 @@ the `max_boost` parameter. The default for `max_boost` is FLT_MAX. Finally, the newly computed score is combined with the score of the query. The parameter `boost_mode` defines how: +[horizontal] `multiply`:: query score and function score is multiplied (default) `replace`:: only function score is used, the query score is ignored `sum`:: query score and function score are added @@ -180,15 +181,16 @@ decay function is specified as where `DECAY_FUNCTION` can be "linear", "exp" and "gauss" (see below). The `offset` and `decay` parameters are optional. +[horizontal] `offset`:: If an `offset` is defined, the decay function will only compute a the decay function for documents with a distance greater that the defined `offset`. The default is 0. -`decay`:: -The `decay` parameter defines how documents are scored at the distance -given at `scale`. If no `decay` is defined, documents at the distance -`scale` will be scored 0.5. +`decay`:: + The `decay` parameter defines how documents are scored at the distance + given at `scale`. If no `decay` is defined, documents at the distance + `scale` will be scored 0.5. For example, your documents might represents hotels and contain a geo location field. You want to compute a decay function depending on how