def test_hybrid_search_score_modifiers(self):
        """
        Tests that score modifiers work as expected for all methods
        """
        for index_name in [self.text_index_name, self.unstructured_text_index_name]:
            with self.subTest(index=index_name):
                # Add documents
                self.client.index(index_name).add_documents(
                    [
                        {"_id": "doc6", "text_field_1": "HELLO WORLD"},
                        {"_id": "doc7", "text_field_1": "HELLO WORLD", "add_field_1": 1.0},  # third
                        {"_id": "doc8", "text_field_1": "HELLO WORLD", "mult_field_1": 2.0},  # second highest score
                        {"_id": "doc9", "text_field_1": "HELLO WORLD", "mult_field_1": 3.0},  # highest score
                        {"_id": "doc10", "text_field_1": "HELLO WORLD", "mult_field_2": 3.0},  # lowest score
                    ],
                    tensor_fields=["text_field_1"] if "unstructured" in index_name else None
                )

                with self.subTest("retrieval: lexical, ranking: tensor"):
                    hybrid_res = self.client.index(index_name).search(
                        "HELLO WORLD",
                        search_method="HYBRID",
                        hybrid_parameters={
                            "retrievalMethod": "lexical",
                            "rankingMethod": "tensor",
                            "scoreModifiersTensor":{
                                "multiply_score_by": [
                                    {"field_name": "mult_field_1", "weight": 10},
                                    {"field_name": "mult_field_2", "weight": -10}
                                ],
                                "add_to_score": [
                                    {"field_name": "add_field_1", "weight": 5}
                                ]
                            },
                        },
                        limit=10
                    )
                    # TODO investigate why the score modifier has changed
                    self.assertIn("hits", hybrid_res)
                    self.assertEqual(hybrid_res["hits"][0]["_id"], "doc9")  # highest score (score*10*3)
                    self.assertAlmostEqual(hybrid_res["hits"][0]["_score"], 30.0, places=4)
                    self.assertEqual(hybrid_res["hits"][1]["_id"], "doc8")  # (score*10*2)
                    self.assertAlmostEqual(hybrid_res["hits"][1]["_score"], 20.0, places=4)
                    self.assertEqual(hybrid_res["hits"][2]["_id"], "doc7")  # (score + 5*1)
                    self.assertAlmostEqual(hybrid_res["hits"][2]["_score"], 6.0, places=4)
                    self.assertEqual(hybrid_res["hits"][3]["_id"], "doc6")  # (score)
                    self.assertAlmostEqual(hybrid_res["hits"][3]["_score"], 1.0, places=4)
                    self.assertEqual(hybrid_res["hits"][-1]["_id"], "doc10")  # lowest score (score*-10*3)
                    self.assertAlmostEqual(hybrid_res["hits"][-1]["_score"], -30.0, places=4)

                with self.subTest("retrieval: tensor, ranking: lexical"):
                    hybrid_res = self.client.index(index_name).search(
                        "HELLO WORLD",
                        search_method="HYBRID",
                        hybrid_parameters={
                            "retrievalMethod": "tensor",
                            "rankingMethod": "lexical",
                            "scoreModifiersLexical":{
                                "multiply_score_by": [
                                    {"field_name": "mult_field_1", "weight": 10},
                                    {"field_name": "mult_field_2", "weight": -10}
                                ],
                                "add_to_score": [
                                    {"field_name": "add_field_1", "weight": 2}
                                ]
                            },
                        },
                        limit=10
                    )
                    self.assertIn("hits", hybrid_res)

                    base_lexical_score = hybrid_res["hits"][3]["_score"]
                    self.assertEqual(hybrid_res["hits"][0]["_id"], "doc9")  # highest score (score*10*3)
                    self.assertAlmostEqual(hybrid_res["hits"][0]["_score"], base_lexical_score * 10 * 3)
                    self.assertEqual(hybrid_res["hits"][1]["_id"], "doc8")  # second highest score (score*10*2)
                    self.assertAlmostEqual(hybrid_res["hits"][1]["_score"], base_lexical_score * 10 * 2)
                    self.assertEqual(hybrid_res["hits"][2]["_id"], "doc7")  # third highest score (score + 2*1)
                    self.assertAlmostEqual(hybrid_res["hits"][2]["_score"], base_lexical_score + 2 * 1)
                    self.assertEqual(hybrid_res["hits"][3]["_id"], "doc6")  # ORIGINAL SCORE
                    self.assertEqual(hybrid_res["hits"][-1]["_id"], "doc10")  # lowest score (score*-10*3)
                    self.assertAlmostEqual(hybrid_res["hits"][-1]["_score"], base_lexical_score * -10 * 3)

                with self.subTest("retrieval: disjunction, ranking: rrf"):
                    hybrid_res = self.client.index(index_name).search(
                        "HELLO WORLD",
                        search_method="HYBRID",
                        hybrid_parameters={
                            "retrievalMethod": "disjunction",
                            "rankingMethod": "rrf",
                            "scoreModifiersLexical":{
                                "multiply_score_by": [
                                    {"field_name": "mult_field_1", "weight": 10},
                                    {"field_name": "mult_field_2", "weight": -10}
                                ],
                                "add_to_score": [
                                    {"field_name": "add_field_1", "weight": 5}
                                ]
                            },
                            "scoreModifiersTensor":{
                                "multiply_score_by": [
                                    {"field_name": "mult_field_1", "weight": 10},
                                    {"field_name": "mult_field_2", "weight": -10}
                                ],
                                "add_to_score": [
                                    {"field_name": "add_field_1", "weight": 5}
                                ]
                            },
                        },
                        limit=10
                    )
                    self.assertIn("hits", hybrid_res)

                    # Score without score modifiers
                    self.assertEqual(hybrid_res["hits"][3]["_id"], "doc6")  # (score)
                    base_lexical_score = hybrid_res["hits"][3]["_lexical_score"]
                    base_tensor_score = hybrid_res["hits"][3]["_tensor_score"]

                    self.assertEqual(hybrid_res["hits"][0]["_id"], "doc9")  # highest score (score*10*3)
                    self.assertAlmostEqual(hybrid_res["hits"][0]["_lexical_score"], base_lexical_score * 10 * 3)
                    self.assertEqual(hybrid_res["hits"][0]["_tensor_score"], base_tensor_score * 10 * 3)

                    self.assertEqual(hybrid_res["hits"][1]["_id"], "doc8")  # (score*10*2)
                    self.assertAlmostEqual(hybrid_res["hits"][1]["_lexical_score"], base_lexical_score * 10 * 2)
                    self.assertAlmostEqual(hybrid_res["hits"][1]["_tensor_score"], base_tensor_score * 10 * 2)

                    self.assertEqual(hybrid_res["hits"][2]["_id"], "doc7")  # (score + 5*1)
                    self.assertAlmostEqual(hybrid_res["hits"][2]["_lexical_score"], base_lexical_score + 5 * 1)
                    self.assertAlmostEqual(hybrid_res["hits"][2]["_tensor_score"], base_tensor_score + 5 * 1)

                    self.assertEqual(hybrid_res["hits"][-1]["_id"], "doc10")  # lowest score (score*-10*3)
                    self.assertAlmostEqual(hybrid_res["hits"][-1]["_lexical_score"], base_lexical_score * -10 * 3)
                    self.assertAlmostEqual(hybrid_res["hits"][-1]["_tensor_score"], base_tensor_score * -10 * 3)

        Tests that score modifiers work as expected for all methods
        
tests/api_tests/v1/tests/api_tests/structured_index/test_hybrid_search.py