def test_search_result_scores_match_2_9(self):
        """
        Tests that both lexical and tensor search results and scores match those
        of Marqo 2.9.0
        """

        for index in [self.structured_text_index_score_modifiers, self.unstructured_text_index]:
            with self.subTest(index=type(index)):

                docs_with_same_bm25_score = [("doc8", "doc9")]

                # Select results
                if isinstance(index, (StructuredMarqoIndex, SemiStructuredMarqoIndex)):
                    expected_results = results_2_9.search_results_structured
                elif isinstance(index, UnstructuredMarqoIndex):
                    expected_results = results_2_9.search_results_unstructured
                    docs_with_same_bm25_score.append(("doc7", "doc11"))

                # Add documents
                self.add_documents(
                    config=self.config,
                    add_docs_params=AddDocsParams(
                        index_name=index.name,
                        docs=self.docs_list,
                        tensor_fields=["text_field_1", "text_field_2", "text_field_3"] if \
                            isinstance(index, UnstructuredMarqoIndex) else None
                    )
                )

                for search_method in [SearchMethod.TENSOR, SearchMethod.LEXICAL]:
                    with self.subTest(search_method=search_method):
                        # Search
                        search_res = tensor_search.search(
                            config=self.config,
                            index_name=index.name,
                            text="dogs",
                            search_method=search_method,
                            result_count=10
                        )


                        self.assertEqual(len(search_res["hits"]), len(expected_results[search_method]))
                        for i in range(len(search_res["hits"])):
                            # Docs with same bm25 score are interchangeable in order
                            same_score_group = ()
                            for group in docs_with_same_bm25_score:
                                if search_res["hits"][i]["_id"] in group:
                                    same_score_group = group

                            if (search_res["hits"][i]["_id"] in same_score_group) and (search_method == SearchMethod.LEXICAL):
                                self.assertIn(expected_results[search_method][i]["_id"], same_score_group)
                            else:
                                self.assertEqual(search_res["hits"][i]["_id"], expected_results[search_method][i]["_id"])
                            self.assertTrue(np.allclose(search_res["hits"][i]["_score"], expected_results[search_method][i]["_score"], atol=1e-6),
                                            msg=f'Score of Hit {i} do not match in {search_method} search on {index.type} index, '
                                                f'expected: {expected_results[search_method][i]["_score"]}, '
                                                f'actual: {search_res["hits"][i]["_score"]}')

        Tests that both lexical and tensor search results and scores match those
        of Marqo 2.9.0
        
tests/integ_tests/tensor_search/backwards_compat/test_search_regression.py