From 1054bec261d9ceee90fa74badd9563ad6a96eecc Mon Sep 17 00:00:00 2001 From: Radu Gheorghe Date: Tue, 3 Sep 2024 10:54:11 +0300 Subject: [PATCH] Change Elasticsearch to dot_product similarity With our normalized vectors, the score should be exactly the same as "cosine", but we don't force Elasticsearch to normalize vectors at query time. Which is similar to what our prenormalized-angular does: effectively orders by cosine similarity, assuming vectors are normalized. --- .../ecommerce_hybrid_search/app_es/index-settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/performance/ecommerce_hybrid_search/app_es/index-settings.json b/tests/performance/ecommerce_hybrid_search/app_es/index-settings.json index 9cf508f1d..9a9672e2e 100644 --- a/tests/performance/ecommerce_hybrid_search/app_es/index-settings.json +++ b/tests/performance/ecommerce_hybrid_search/app_es/index-settings.json @@ -12,7 +12,7 @@ "type": "dense_vector", "dims": 384, "index": true, - "similarity": "cosine", + "similarity": "dot_product", "index_options": {"type": "hnsw", "ef_construction": 200, "m": 16} } }