def _generate_unstructured_schema(self, marqo_index: UnstructuredMarqoIndex) -> str:
        """This function generates the Vespa schema for an unstructured Marqo index."""
        dimension = str(marqo_index.model.get_dimension())

        schema = textwrap.dedent(
            f"""
            schema {marqo_index.schema_name} {{
                document {{
                    field {self._FIELD_ID} type string {{
                        indexing: attribute | summary
                        attribute: fast-search
                        rank: filter
                    }}

                    field {self._STRINGS} type array<string>{{
                        indexing: index
                        index: enable-bm25
                    }}

                    field {self._LONGS_STRINGS_FIELDS} type map<string, string> {{
                        indexing: summary
                    }}

                    field {self._SHORT_STRINGS_FIELDS} type map<string, string> {{
                        indexing: summary
                        struct-field key {{ indexing : attribute
                                           attribute: fast-search
                                           rank: filter }}
                        struct-field value {{ indexing : attribute
                                              attribute: fast-search
                                              rank: filter }}
                    }}

                    field {self._STRING_ARRAY} type array<string> {{
                        indexing: attribute | summary
                        attribute: fast-search
                        rank: filter
                    }}
                    
                    field {unstructured_common.VESPA_DOC_MULTIMODAL_PARAMS} type map<string, string> {{
                        indexing: summary
                    }}

                    field {self._INT_FIELDS} type map<string, long> {{
                        indexing: summary
                        struct-field key {{ indexing : attribute
                                           attribute: fast-search
                                           rank: filter }}
                        struct-field value {{ indexing : attribute
                                           attribute: fast-search
                                           rank: filter }}
                    }}
                    
                    field {self._BOOL_FIELDS} type map<string, byte> {{
                        indexing: summary
                        struct-field key {{ indexing : attribute
                                            attribute: fast-search
                                            rank: filter }}
                        struct-field value {{ indexing : attribute
                                              attribute: fast-search
                                              rank: filter }}
                        }}
                                                    
                    field {self._FLOAT_FIELDS} type map<string, double> {{
                        indexing: summary
                        struct-field key {{ indexing : attribute
                                           attribute: fast-search
                                           rank: filter }}

                        struct-field value {{ indexing : attribute
                                           attribute: fast-search
                                           rank: filter }}
                    }}

                    field {self._SCORE_MODIFIERS} type tensor<double>(p{{}}) {{
                        indexing: attribute | summary
                    }}

                    field {self._CHUNKS} type array<string> {{
                        indexing: summary
                    }}
                    
                    field {unstructured_common.FIELD_VECTOR_COUNT} type int {{
                        indexing: attribute | summary
                    }}
                    
                    field {self._EMBEDDINGS} type tensor<float>(p{{}}, x[{dimension}]) {{
                        indexing: attribute | index | summary
                        attribute {{
                            distance-metric: {self._get_distance_metric(marqo_index.distance_metric)}
                        }}
                        index {{
                            hnsw {{
                                max-links-per-node: {marqo_index.hnsw_config.m}
                                neighbors-to-explore-at-insert: {marqo_index.hnsw_config.ef_construction}
                            }}
                        }}
                    }}
                }}

                fieldset default {{
                    fields: {self._STRINGS}
                }}
            """
        )

        # Add rank profiles
        schema += self._generate_rank_profiles(marqo_index)

        # Add summaries
        schema += textwrap.dedent(
            f"""
                document-summary {self._SUMMARY_ALL_NON_VECTOR} {{
                    summary {self._FIELD_ID} type string {{}}
                    summary {self._STRINGS} type array<string> {{}}
                    summary {self._LONGS_STRINGS_FIELDS} type map<string, string> {{}}
                    summary {self._SHORT_STRINGS_FIELDS} type map<string, string> {{}}
                    summary {self._STRING_ARRAY} type array<string> {{}}
                    summary {self._BOOL_FIELDS} type map<string, byte> {{}}
                    summary {self._INT_FIELDS} type map<string, long> {{}}
                    summary {self._FLOAT_FIELDS} type map<string, double> {{}}
                    summary {self._CHUNKS} type array<string> {{}}
                }}

                document-summary {self._SUMMARY_ALL_VECTOR} {{
                    summary {self._FIELD_ID} type string {{}}
                    summary {self._STRINGS} type array<string> {{}}
                    summary {self._LONGS_STRINGS_FIELDS} type map<string, string> {{}}
                    summary {self._SHORT_STRINGS_FIELDS} type map<string, string> {{}}
                    summary {self._STRING_ARRAY} type array<string> {{}}
                    summary {self._BOOL_FIELDS} type map<string, byte> {{}}
                    summary {self._INT_FIELDS} type map<string, long> {{}}
                    summary {self._FLOAT_FIELDS} type map<string, double> {{}}
                    summary {self._CHUNKS} type array<string> {{}}
                    summary {self._EMBEDDINGS} type tensor<float>(p{{}}, x[{dimension}]) {{}}
                }}
            }}
            """
        )

        return schema
This function generates the Vespa schema for an unstructured Marqo index.
src/marqo/core/unstructured_vespa_index/unstructured_vespa_schema.py