Skip to content

Commit

Permalink
Documentation for score_mode
Browse files Browse the repository at this point in the history
Closes #4742
  • Loading branch information
nik9000 authored and jpountz committed Jan 23, 2014
1 parent 55e8df4 commit 37f80c8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions docs/reference/search/request/rescore.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ number of docs which will be examined on each shard can be controlled by
the `window_size` parameter, which defaults to
<<search-request-from-size,`from` and `size`>>.

The scores from the original query and the rescore query are combined
linearly to produce the final `_score` for each document. The relative
importance of the original query and of the rescore query can be
controlled with the `query_weight` and `rescore_query_weight`
By default the scores from the original query and the rescore query are
combined linearly to produce the final `_score` for each document. The
relative importance of the original query and of the rescore query can
be controlled with the `query_weight` and `rescore_query_weight`
respectively. Both default to `1`.

For example:
Expand Down Expand Up @@ -67,3 +67,15 @@ curl -s -XPOST 'localhost:9200/_search' -d '{
}
'
--------------------------------------------------

The way the scores are combined can be controled with the `score_mode`:
[cols="<,<",options="header",]
|=======================================================================
|Score Mode |Description
|`total` |Add the original score and the rescore query score. The default.
|`multiply` |Multiply the original score by the rescore query score. Useful
for <<query-dsl-function-score-query,`function query`>> rescores.
|`avg` |Average the original score and the rescore query score.
|`max` |Take the max of original score and the rescore query score.
|`min` |Take the min of the original score and the rescore query score.
|=======================================================================

0 comments on commit 37f80c8

Please sign in to comment.