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}")
        errors = []  # Collect errors to report them at the end
        self.create_indexes(self.indexes_to_test_on)
        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,
                                                                               mappings=self.mappings,
                                                                               tensor_fields=self.tensor_fields)

            except Exception as e:
                errors.append((index, str(e)))


        all_results = {}
        # Loop through queries, search methods, and result keys to populate unstructured_results
        for index in self.indexes_to_test_on:
            index_name = index['indexName']
            try:
                all_results[index_name] = {}

                result = self.client.index(index_name).recommend(
                    documents = ["example_doc_1", "example_doc_2"],
                    limit = 10,
                    offset = 0,
                    show_highlights = True,
                    attributes_to_retrieve=["text_field", "tags", "caption"]
                )
                all_results[index_name] = result
            except Exception as e:
                errors.append((index, traceback.format_exc()))
        if errors:
            failure_message = "\n".join([
                f"Failure in index {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")

        # store the result of search across all structured & unstructured indexes
        self.save_results_to_file(all_results)
        self.logger.debug(f'Ran prepare method for {self.indexes_to_test_on} inside test class {self.__class__.__name__}')

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