def METHOD_NAME(self, model_class: type[Model], schema: Schema):
    mapper = sa.inspect(model_class)
    args = self.doc_attrs
    # Any field not in schema will be stored here.
    # After all field have been discovered, we add the missing ones.
    field_definitions = {}
    def setup_field(attr_name: str, field_name: tuple[str, type | ID] | str):
        field_def = False
        if not isinstance(field_name, str):
            field_name, field_def = field_name
        if field_name not in schema:
            if (
                field_name not in field_definitions
                or field_definitions[field_name] is False
            ):
                field_definitions[field_name] = field_def
        # attrgetter offers dotted name support. Useful for attributes on
        # related objects.
        args.setdefault(field_name, {})[attr_name] = attrgetter(attr_name)
    # model level definitions
    for name, field_names in self.index_to:
        if isinstance(field_names, str):
            field_names = (field_names,)
        for field_name in field_names:
            setup_field(name, field_name)
    # per column definitions
    for col in mapper.columns:
        name = col.name
        info = col.info
        if not info.get("searchable"):
            continue
        index_to = info.get("index_to", (name,))
        if isinstance(index_to, str):
            index_to = (index_to,)
        for field_name in index_to:
            setup_field(name, field_name)
    # add missing fields to schema
    for field_name, field_def in field_definitions.items():
        if field_name in schema:
            continue
        if field_def is False:
            field_def = TEXT(stored=True, analyzer=accent_folder)
        logger.debug(
            "Adding field to schema:\n" "  Model: %s\n" '  Field: "%s" %s',
            model_class._object_type(),
            field_name,
            field_def,
        )
        schema.add(field_name, field_def)