def prepare(self):
        """
        Prepare the indexes and add documents for the test.
        Also store the search results for later comparison.
        """
        self.logger.debug(f"Creating indexes {self.indexes_to_test_on}")
        self.create_indexes(self.indexes_to_test_on)
        errors = []  # Collect errors to report them at the end

        self.logger.debug(f'Feeding documents to {self.indexes_to_test_on}')
        for index in self.indexes_to_test_on:
            try:
                if index.get("type") is not None and index.get('type') == 'structured':
                    self.client.index(index_name=index['indexName']).add_documents(documents=self.docs)
                else:
                    self.client.index(index_name=index['indexName']).add_documents(documents=self.docs,
                                                                                   tensor_fields=self.tensor_fields)
            except Exception as e:
                errors.append((index, traceback.format_exc()))

        all_results = {}
        # Loop through ranking/retrieval methods and result keys to populate results
        for index in self.indexes_to_test_on:
            index_name = index['indexName']
            if index_name not in all_results:
                all_results[index_name] = {}

            for retrieval_method, ranking_method in self.hybrid_test_cases:
                try:
                    if retrieval_method not in all_results[index_name]:
                        all_results[index_name][retrieval_method] = {}
                        
                    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
                    )
                    all_results[index_name][retrieval_method][ranking_method] = result
                    self.logger.debug(f"Result for {index_name} with retrieval method {retrieval_method} "
                                      f"and ranking method {ranking_method}: {result}")
                except Exception as e:
                    errors.append((index_name, traceback.format_exc()))

        if errors:
            failure_message = "\n".join([
                f"Failure in idx: {idx} : {error}"
                for idx, error in errors
            ])
            self.logger.error(f"Some subtests failed:\n{failure_message}. When the corresponding test runs for this index, it is expected to fail")

        self.save_results_to_file(all_results)
        # store the result of search across all structured & unstructured indexes

        Prepare the indexes and add documents for the test.
        Also store the search results for later comparison.
        
tests/compatibility_tests/search/test_search_with_global_score_modifiers.py