def build_field_group(field_config, field_name, field_id, field_type_overwrite=None) -> str:
            """Build the complete group request for a field."""
            group_expr = build_group_expression(field_config, field_name, field_id, field_type_overwrite)
            params = build_group_parameters(field_config)

            # Build output expression
            if field_config.type == "number":
                aggregations = ["sum", "avg", "min", "max"]
                field_type = FIELD_TYPES[field_type_overwrite]
                funcs = [f'{func}({field_type}{{"{field_name}"}})' for func in aggregations]
                funcs.append("count()")
                output = f"each(output({', '.join(funcs)}))"
            else:
                output = "each(output(count()))"

            return f"all(group({group_expr}) {params} {output}) "
Build the complete group request for a field.
src/marqo/core/semi_structured_vespa_index/semi_structured_vespa_index.py