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:
            tensor_fields = ["text_field"] if "unstr" in index.get("type") else None
            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=tensor_fields)
            except Exception as e:
                errors.append((index, traceback.format_exc()))

        all_results = {}
        # Loop through queries, search methods, and result keys to populate unstructured_results
        for type_of_score_modifier in ["double_score_mods", "long_score_mods", "rating", "popularity"]:
            for index in self.indexes_to_test_on:
                index_name = index['indexName']
                if index_name not in all_results:
                    all_results[index_name] = {}

                try:
                    result = self.client.index(index_name).search(
                        q="",
                        score_modifiers={"add_to_score": [
                            {
                                "field_name": type_of_score_modifier,
                                "weight": 2
                            }
                        ]
                        }
                    )
                    all_results[index_name][type_of_score_modifier] = 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_score_modifiers.py