def from_marqo_document(cls, document: Dict, filter_string_max_length: int) -> "UnstructuredVespaDocument":
        """Instantiate an UnstructuredVespaDocument from a valid Marqo document from
        add_documents"""

        if index_constants.MARQO_DOC_ID not in document:
            raise MarqoDocumentParsingError(f"Unstructured Marqo document does not have a "
                                            f"{index_constants.MARQO_DOC_ID} field. "
                                            f"This should be assigned for a valid document")

        doc_id = document[index_constants.MARQO_DOC_ID]
        instance = cls(id=doc_id, fields=UnstructuredVespaDocumentFields(marqo__id=doc_id))

        for key, value in document.items():
            if key in [index_constants.MARQO_DOC_EMBEDDINGS, index_constants.MARQO_DOC_CHUNKS,
                       unstructured_common.MARQO_DOC_MULTIMODAL_PARAMS, index_constants.MARQO_DOC_ID]:
                continue
            if isinstance(value, str):
                if len(value) <= filter_string_max_length:
                    instance.fields.short_string_fields[key] = value
                else:
                    instance.fields.long_string_fields[key] = value
                instance.fields.strings.append(value)
            elif isinstance(value, bool):
                instance.fields.bool_fields[key] = int(value)
            elif isinstance(value, list) and all(isinstance(elem, str) for elem in value):
                instance.fields.string_arrays.extend([f"{key}::{element}" for element in value])
            elif isinstance(value, int):
                instance.fields.int_fields[key] = value
                instance.fields.score_modifiers_fields[key] = value
            elif isinstance(value, float):
                instance.fields.float_fields[key] = value
                instance.fields.score_modifiers_fields[key] = value
            elif isinstance(value, dict):
                for k, v in value.items():
                    if isinstance(v, int):
                        instance.fields.int_fields[f"{key}.{k}"] = v
                        instance.fields.score_modifiers_fields[f"{key}.{k}"] = v
                    elif isinstance(v, float):
                        instance.fields.float_fields[f"{key}.{k}"] = float(v)
                        instance.fields.score_modifiers_fields[f"{key}.{k}"] = v
            else:
                raise MarqoDocumentParsingError(f"In document {doc_id}, field {key} has an "
                                                f"unsupported type {type(value)} which has not been "
                                                f"validated in advance.")

        instance.fields.vespa_multimodal_params = document.get(unstructured_common.MARQO_DOC_MULTIMODAL_PARAMS, {})
        instance.fields.vespa_embeddings = document.get(index_constants.MARQO_DOC_EMBEDDINGS, {})
        instance.fields.vespa_chunks = document.get(index_constants.MARQO_DOC_CHUNKS, [])
        instance.fields.vector_counts = len(instance.fields.vespa_embeddings)
        return instance
Instantiate an UnstructuredVespaDocument from a valid Marqo document from
        add_documents
src/marqo/core/unstructured_vespa_index/unstructured_document.py