def test_search_with_global_score_modifiers(self):
        """Run search queries and compare the results with the stored results."""
        self.logger.info(f"Running test_search on {self.__class__.__name__}")
        stored_results = self.load_results_from_file()
        test_failures = [] #this stores the failures in the subtests. These failures could be assertion errors or any other types of exceptions.

        for index in self.indexes_to_test_on:
            index_name = index['indexName']
            for retrieval_method, ranking_method in self.hybrid_test_cases:
                try:
                    result = self.client.index(index_name).search(
                        q="dogs",
                        search_method="HYBRID",
                        hybrid_parameters={
                            "retrievalMethod": retrieval_method,
                            "rankingMethod": ranking_method
                        },
                        score_modifiers={
                            "multiply_score_by": [
                                {
                                    "field_name": "multiply_1",
                                    "weight": 2
                                }
                            ],
                            "add_to_score": [
                                {
                                    "field_name": "add_1",
                                    "weight": 3
                                }
                            ]
                        },
                        rerank_depth=2  # To show not all results are reranked
                    )
                    self.assertEqual(stored_results[index_name][retrieval_method][ranking_method].get("hits"),
                                     result.get("hits"))
                except Exception as e:
                    test_failures.append((index_name, traceback.format_exc()))

        if test_failures:
            failure_message = "\n".join([
                f"Failure in idx: {idx} : {error}"
                for idx, error in test_failures
            ])
            self.fail(f"Some subtests failed:\n{failure_message}")
Run search queries and compare the results with the stored results.
tests/compatibility_tests/search/test_search_with_global_score_modifiers.py