Adds new field to collection. When field already exists, it will be updated (merged with existing one).
When adding content field with it's value multiple times, the value is appended to existing content.
Namespace: CMS.DataEngineAssembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 8.0.0.0 (8.1.5347.20411)
Parameters
- fieldName
- Type:
System String
Field name
- searchable
- Type:
System Boolean
Indicates if field can be searched
- tokenized
- Type:
System Boolean
Indicates if field will be tokenized
- getValueFunc
- Type:
System Func
Object
Function that returns value of the field
- insertDirectly (Optional)
- Type:
System Boolean
Indicates if field should be insert directly into search document whithout aditional processing
- analyzer (Optional)
- Type:
System Nullable SearchAnalyzerTypeEnum
Explicit analyzer to process search field's value. When null default analyzer is used.
Return Value
Type: ISearchFieldNewly added or existing field
Exceptions
Exception | Condition |
---|---|
![]() | When StoreValues is true and we try to add already existing field but with different value. |
See Also