Click or drag to resize
SearchFieldsAdd Method (String, Boolean, Boolean, FuncObject, Boolean, NullableSearchAnalyzerTypeEnum)
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.Search
Assembly: CMS.Search (in CMS.Search.dll) Version: 8.2.23
Syntax
C#
public virtual ISearchField Add(
	string fieldName,
	bool searchable,
	bool tokenized,
	Func<Object> getValueFunc,
	bool insertDirectly = false,
	Nullable<SearchAnalyzerTypeEnum> analyzer = null
)

Parameters

fieldName
Type: SystemString
Field name
searchable
Type: SystemBoolean
Indicates if field can be searched
tokenized
Type: SystemBoolean
Indicates if field will be tokenized
getValueFunc
Type: SystemFuncObject
Function that returns value of the field
insertDirectly (Optional)
Type: SystemBoolean
Indicates if field should be insert directly into search document whithout aditional processing
analyzer (Optional)
Type: SystemNullableSearchAnalyzerTypeEnum
Explicit analyzer to process search field's value. When null default analyzer is used

Return Value

Type: ISearchField
Newly added or existing field

Implements

ISearchFieldsAdd(String, Boolean, Boolean, FuncObject, Boolean, NullableSearchAnalyzerTypeEnum)
Exceptions
ExceptionCondition
InvalidOperationExceptionWhen StoreValues is true and we try to add already existing field but with different value.
See Also