def test_score_modifier_with_zero_value(self):
        """Test behavior when a score modifier has a zero value"""
        for index_name in [self.structured_index_name, self.unstructured_index_name]:
            with self.subTest(index_name=index_name):
                docs = [
                    {"_id": "1", "text_field": "test", "double_score_mods": 0.0},
                    {"_id": "2", "text_field": "test", "double_score_mods": 1.0},
                ]
                tensor_fields = ["text_field"] if "unstr" in index_name else None
                self.client.index(index_name).add_documents(documents=docs, tensor_fields=tensor_fields)

                res = self.client.index(index_name).search(
                    q="",
                    score_modifiers={
                        "multiply_score_by": [{"field_name": "double_score_mods", "weight": 1}]
                    }
                )
                
                # Expected score calculation:
                # Doc 1: base_score * 0.0 = 0
                # Doc 2: base_score * 1.0 = base_score
                base_score = 0.845687427
                self.assertGreater(res["hits"][0]["_score"], res["hits"][1]["_score"])
                self.assertNotEqual(res["hits"][0]["_score"], 0)
                self.assertLess(res["hits"][1]["_score"], base_score)
Test behavior when a score modifier has a zero value
tests/api_tests/v1/tests/api_tests/test_dict_score_modifiers.py