def test_hybrid_search_rrf_score_modifiers_with_rerank_depth(self):
        """
        Test that hybrid search with RRF can use root level score_modifiers and rerank_depth
        """

        docs_list = [
            {"_id": "both1", "text_field": "dogs", "multiply_1": -1, "add_1": -1},           # HIGH tensor, LOW lexical
            {"_id": "tensor1", "text_field": "puppies", "multiply_1": 2, "add_1": 2},         # MID tensor
            {"_id": "tensor2", "text_field": "random words", "multiply_1": 3, "add_1": 3},    # LOW tensor
        ]

        for test_index_name in [self.unstructured_score_modifier_index_name, self.structured_score_modifier_index_name]:
            with self.subTest(index=test_index_name):
                self.client.index(test_index_name).add_documents(
                    docs_list,
                    tensor_fields=["text_field"] if "unstr" in test_index_name else None)

                # Get unmodified scores
                # Unmodified result order should be: both1, tensor1, tensor2
                unmodified_results = self.client.index(test_index_name).search(q="dogs", search_method="HYBRID",limit=3)
                unmodified_scores = {hit["_id"]: hit["_score"] for hit in unmodified_results["hits"]}
                self.assertEqual(["both1", "tensor1", "tensor2"], [hit["_id"] for hit in unmodified_results["hits"]])

                # Get modified scores (rank all 3)
                # Modified result order should be: tensor2, tensor1, both1
                score_modifiers = {
                    "multiply_score_by": [
                        {"field_name": "multiply_1", "weight": 1}
                    ],
                    "add_to_score": [
                        {"field_name": "add_1", "weight": 1}
                    ]
                }
                with self.subTest(f"Case 1: limit == rerankCount == hits.size()"):
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID",
                        limit=3, rerank_depth=3, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["tensor2", "tensor1", "both1"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], 3*unmodified_scores["tensor2"] + 3)
                    self.assertAlmostEqual(modified_results["hits"][1]["_score"], 2*unmodified_scores["tensor1"] + 2)
                    self.assertAlmostEqual(modified_results["hits"][2]["_score"], -1*unmodified_scores["both1"] - 1)

                    # Get modified scores (rank only 1). Only both1 should be rescored (goes to the bottom)
                    # Modified result order should be: tensor1, tensor2, both1
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID",
                        limit=3, rerank_depth=1, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["tensor1", "tensor2", "both1"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], unmodified_scores["tensor1"])     # unmodified
                    self.assertAlmostEqual(modified_results["hits"][1]["_score"], unmodified_scores["tensor2"])     # unmodified
                    self.assertAlmostEqual(modified_results["hits"][2]["_score"], -1*unmodified_scores["both1"] - 1)    # modified

                with self.subTest(f"Case 2: limit < rerankCount < hits.size()"):
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID",
                        limit=1, rerank_depth=2, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["both1"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], -1*unmodified_scores["both1"] - 1)

                with self.subTest(f"Case 3: limit == rerankCount < hits.size()"):
                    # tensor2 never appears, because it is the 3rd result out of tensor
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID",
                        limit=2, rerank_depth=2, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["tensor1", "both1"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], 2*unmodified_scores["tensor1"] + 2)
                    self.assertAlmostEqual(modified_results["hits"][1]["_score"], -1*unmodified_scores["both1"] - 1)

                with self.subTest(f"Case 4: limit < hits.size() < rerankCount"):
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID",
                        limit=2, rerank_depth=10, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["tensor1", "both1"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], 2 * unmodified_scores["tensor1"] + 2)
                    self.assertAlmostEqual(modified_results["hits"][1]["_score"], -1 * unmodified_scores["both1"] - 1)

                with self.subTest(f"Case 5: rerankCount < hits.size() < limit"):
                    # tensor2 remains unmodified.
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID",
                        limit=10, rerank_depth=2, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["tensor1", "tensor2", "both1"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], 2 * unmodified_scores["tensor1"] + 2)
                    self.assertAlmostEqual(modified_results["hits"][1]["_score"], unmodified_scores["tensor2"])
                    self.assertAlmostEqual(modified_results["hits"][2]["_score"], -1 * unmodified_scores["both1"] - 1)

                with self.subTest("Case 6: rerankCount == 0"):
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID", hybrid_parameters={"verbose": True},
                        limit=3, rerank_depth=0, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["both1", "tensor1", "tensor2"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], unmodified_scores["both1"])
                    self.assertAlmostEqual(modified_results["hits"][1]["_score"], unmodified_scores["tensor1"])
                    self.assertAlmostEqual(modified_results["hits"][2]["_score"], unmodified_scores["tensor2"])

                with self.subTest("Case 7: No rerankCount"):
                    modified_results = self.client.index(test_index_name).search(
                        q="dogs", search_method="HYBRID",
                        limit=3, score_modifiers=score_modifiers
                    )
                    self.assertEqual(["tensor2", "tensor1", "both1"], [hit["_id"] for hit in modified_results["hits"]])
                    self.assertAlmostEqual(modified_results["hits"][0]["_score"], 3 * unmodified_scores["tensor2"] + 3)
                    self.assertAlmostEqual(modified_results["hits"][1]["_score"], 2 * unmodified_scores["tensor1"] + 2)
                    self.assertAlmostEqual(modified_results["hits"][2]["_score"], -1 * unmodified_scores["both1"] - 1)

        Test that hybrid search with RRF can use root level score_modifiers and rerank_depth
        
tests/api_tests/v1/tests/api_tests/test_score_modifiers_search.py