OrchardCMS/OrchardCore · error · ArgumentOutOfRangeException

The type ' ' is not support by Azure AI Search

Error message

The type '{type}' is not support by Azure AI Search

What it means

GetFieldType maps Orchard's abstract index field types to Azure AI Search SearchFieldDataType values. An unrecognized type name hits the default arm and throws ArgumentOutOfRangeException, indicating the content field type is not supported by the Azure AI Search connector.

Solutions

  1. Remove the unsupported field from the index mappings or map it to a supported type
  2. Add a custom mapping/converter for your field type before it reaches GetFieldType
  3. Only include supported field types (Boolean, Number, Integer, GeoPoint, Text, Complex, Vector) in AI Search index profiles

Example fix

// before
"type": "Binary"
// after
"type": "Text"
Defensive patterns

Strategy: validation

Validate before calling

var supported = new[] { "Boolean","Number","Integer","GeoPoint","Text","Complex","Vector" }; var ok = supported.Contains(fieldType);

Type guard

bool isSupported = supportedTypes.Contains(fieldType, StringComparer.Ordinal);

Try / catch

try { fieldType = GetFieldType(type); } catch (ArgumentOutOfRangeException ex) when (ex.Message.Contains("not support")) { /* exclude field or map to supported type */ }

Prevention

When it happens

Trigger: Building index field definitions when an index mapping references a field type not in {Boolean, Number, Integer, GeoPoint, Text, Complex, Vector}.

Common situations: Custom content field types added by third-party modules being included in an AI Search index; typo'd type names in manually crafted index definitions; new Orchard field types not yet mapped by the connector.

Related errors


AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13). Data as JSON: /api/errors/f50a3f8bf80b4544. Report an issue: GitHub.

Appendix: source

Thrown at src/OrchardCore/OrchardCore.AzureAI.Core/Services/AzureAISearchIndexManager.cs:460

            IsFilterable = indexMap.IsFilterable,
            IsSortable = indexMap.IsSortable,
            IsHidden = indexMap.IsHidden,
            IsFacetable = indexMap.IsFacetable,
        };
    }

    private static SearchFieldDataType GetFieldType(Types type)
        => type switch
        {
            Types.Boolean => SearchFieldDataType.Boolean,
            Types.DateTime => SearchFieldDataType.DateTimeOffset,
            Types.Number => SearchFieldDataType.Double,
            Types.Integer => SearchFieldDataType.Int64,
            Types.GeoPoint => SearchFieldDataType.GeographyPoint,
            Types.Text => SearchFieldDataType.String,
            Types.Complex => SearchFieldDataType.Complex,
            Types.Vector => SearchFieldDataType.Single,
            _ => throw new ArgumentOutOfRangeException(nameof(type), $"The type '{type}' is not support by Azure AI Search")
        };
}

View on GitHub (pinned to 4306c0717f)