def validate_structured_field(values, marqo_index: bool) -> None:
    """
    Validate a Field or FieldRequest. Raises ValueError if validation fails.

    Args:
        marqo_index: Whether the validation is for a MarqoIndex Field (True) or a MarqoIndexRequest FieldRequest (False)
    """
    name: str = values['name']
    type: FieldType = values['type']
    features: List[FieldFeature] = values['features']
    dependent_fields: Optional[Dict[str, float]] = values['dependent_fields']

    validate_field_name(name)

    if type in [FieldType.ImagePointer, FieldType.MultimodalCombination] and features:
        raise ValueError(f'{name}: Cannot specify features for field of type {type.value}')

    if type == FieldType.MultimodalCombination:
        if not dependent_fields:
            raise ValueError(f'{name}: dependent_fields must be defined for a field of type {type.value}')
    elif dependent_fields:
        raise ValueError(
            f'{name}: dependent_fields must only be defined for fields of type '
            f'{FieldType.MultimodalCombination.value}'
        )

    if FieldFeature.LexicalSearch in features and type not in [FieldType.Text, FieldType.ArrayText,
                                                               FieldType.CustomVector]:
        raise ValueError(
            f'{name}: Field with {FieldFeature.LexicalSearch.value} feature must be of type '
            f'{FieldType.Text.value} or {FieldType.ArrayText.value}'
        )

    if FieldFeature.ScoreModifier in features and type not in [FieldType.Float, FieldType.Int, 
                                                               FieldType.Double, FieldType.MapFloat, 
                                                               FieldType.MapInt, FieldType.MapDouble,
                                                               FieldType.Long, FieldType.MapLong]:
        raise ValueError(
             f'{name}: Field with {FieldFeature.ScoreModifier.value} feature must be of type '
             f'{FieldType.Float.value}, {FieldType.Int.value}, {FieldType.Double.value}, {FieldType.Long.value}, '
             f'{FieldType.MapFloat.value}, {FieldType.MapInt.value}, {FieldType.MapDouble.value}, or {FieldType.MapLong.value}'
         )

    # These validations are specific to marqo_index.Field
    if marqo_index:
        lexical_field_name: Optional[str] = values['lexical_field_name']
        filter_field_name: Optional[str] = values['filter_field_name']

        if FieldFeature.LexicalSearch in features and not lexical_field_name:
            raise ValueError(
                f'{name}: lexical_field_name must be populated when {FieldFeature.LexicalSearch.value} '
                f'feature is present'
            )

        if FieldFeature.Filter in features and not filter_field_name:
            # We can filter anything other than ImagePointer and MultimodalCombination, which don't allow features
            # so no type validation here
            raise ValueError(
                f'{name}: filter_field_name must be populated when {FieldFeature.Filter.value} '
                f'feature is present'
            )

        if lexical_field_name and FieldFeature.LexicalSearch not in features:
            raise ValueError(
                f'{name}: lexical_field_name must only be populated when '
                f'{FieldFeature.LexicalSearch.value} feature is present'
            )

        if filter_field_name and FieldFeature.Filter not in features:
            raise ValueError(
                f'{name}: filter_field_name must only be populated when {FieldFeature.Filter.value} '
                f'feature is present'
            )

    Validate a Field or FieldRequest. Raises ValueError if validation fails.

    Args:
        marqo_index: Whether the validation is for a MarqoIndex Field (True) or a MarqoIndexRequest FieldRequest (False)
    
src/marqo/core/models/marqo_index.py