From 192e03be335a94c9ca3a10725b0a4da29ca40d17 Mon Sep 17 00:00:00 2001 From: tstadel <60758086+tstadel@users.noreply.github.com> Date: Tue, 11 Jan 2022 09:35:02 +0100 Subject: [PATCH] Fix elasticsearch scores if they are 0.0 (#1980) * fix elasticsearch zero scores * remove unnecessary None check --- haystack/document_stores/elasticsearch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haystack/document_stores/elasticsearch.py b/haystack/document_stores/elasticsearch.py index 447e22a2d..6e3951bba 100644 --- a/haystack/document_stores/elasticsearch.py +++ b/haystack/document_stores/elasticsearch.py @@ -957,7 +957,7 @@ class ElasticsearchDocumentStore(BaseDocumentStore): if name: meta_data["name"] = name - score = hit["_score"] if hit["_score"] else None + score = hit["_score"] if score: if adapt_score_for_embedding: score = self._scale_embedding_score(score)