def build_group_expression(field_config, field_name, field_id, field_type_overwrite=None) -> str:
            """Build the group expression for a field."""

            field_type = FIELD_TYPES[field_type_overwrite if field_type_overwrite else field_config.type]

            # Handle numeric fields with ranges
            if field_type in [INT_FIELDS, FLOAT_FIELDS] and field_config.ranges:
                buckets = []
                for range_config in field_config.ranges:
                    from_val = range_config.from_ if range_config.from_ is not None else "-inf"
                    to_val = range_config.to_ if range_config.to_ is not None else "inf"
                    buckets.append(f'bucket({from_val}, {to_val})')
                return f'predefined({field_type}{{"{field_name}"}}, {", ".join(buckets)})'

            elif field_type == STRING_ARRAY:
                return f"{STRING_ARRAY}_{field_name}"

            # Handle fields without ranges
            return str(field_id) if field_type in [INT_FIELDS, FLOAT_FIELDS] else f'{field_type}{{"{field_name}"}}'
Build the group expression for a field.
src/marqo/core/semi_structured_vespa_index/semi_structured_vespa_index.py