This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 1dfe095fd24 Add a note that tells cosine similarities are normalized
(#2092)
1dfe095fd24 is described below
commit 1dfe095fd24f2de497a44b4f7c163c97feb868eb
Author: Hakim <[email protected]>
AuthorDate: Sat Jun 22 16:10:41 2024 +0200
Add a note that tells cosine similarities are normalized (#2092)
---
solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc
b/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc
index 35f5f094c68..a165015837a 100644
--- a/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc
+++ b/solr/solr-ref-guide/modules/query-guide/pages/dense-vector-search.adoc
@@ -96,6 +96,9 @@ this similarity is intended as an optimized way to perform
cosine similarity. In
* `cosine`: https://en.wikipedia.org/wiki/Cosine_similarity[Cosine similarity]
+[NOTE]
+the cosine similarity scores returned by Solr are normalized like this : `(1 +
cosine_similarity) / 2`.
+
[NOTE]
the preferred way to perform cosine similarity is to normalize all vectors to
unit length, and instead use DOT_PRODUCT. You should only use this function if
you need to preserve the original vectors and cannot normalize them in advance.