Skip to content

Commit 9a29ebd

Browse files
committed
Added comment to the class
1 parent b4e7c70 commit 9a29ebd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

docs/reference/elasticsearch/rest-apis/retrievers.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ Each entry specifies the following parameters:
287287

288288
* `l2_norm` : An `L2ScoreNormalizer` that normalizes scores using the L2 norm of the score values.
289289

290-
```
291-
score = score / sqrt(sum(score_i^2))
292-
```
293-
294290
See also [this hybrid search example](docs-content://solutions/search/retrievers-examples.md#retrievers-examples-linear-retriever) using a linear retriever on how to independently configure and apply normalizers to retrievers.
295291

296292
`rank_window_size`

x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/linear/L2ScoreNormalizer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
import org.apache.lucene.search.ScoreDoc;
1212

13+
/**
14+
* A score normalizer that applies L2 normalization to a set of scores.
15+
* <p>
16+
* This normalizer scales the scores so that the L2 norm of the score vector is 1,
17+
* if possible. If all scores are zero or NaN, normalization is skipped and the original scores are returned.
18+
* </p>
19+
*/
1320
public class L2ScoreNormalizer extends ScoreNormalizer {
1421

1522
public static final L2ScoreNormalizer INSTANCE = new L2ScoreNormalizer();

0 commit comments

Comments
 (0)