Click or drag to resize
NamingHelperGetValidFieldName Method
Gets field name which is valid to be used for Azure Search index.

Namespace: CMS.Search.Azure
Assembly: CMS.Search.Azure (in CMS.Search.Azure.dll) Version: 13.0.131
Syntax
C#
public static string GetValidFieldName(
	string fieldName
)

Parameters

fieldName
Type: SystemString
Field name to be renamed so it fulfills Azure Search naming conventions.

Return Value

Type: String
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when fieldName is null.
Remarks

Azure Search has naming rules (https://docs.microsoft.com/en-us/rest/api/searchservice/naming-rules) which field names must follow. Remarkably

  • Allowed characters are letters, numbers and dashes ('_').
  • First character must be a letter.

Since system fields start with a dash (e.g. ID), the default implementation prefixes dash starting name of column by string "sys".

See Also