Class ValueSetValidator
Performing basic validation of a value set
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Examine
Assembly: Umbraco.Infrastructure.dll
Syntax
public class ValueSetValidator : IValueSetValidator
Constructors
View SourceValueSetValidator(IEnumerable<string>?, IEnumerable<string>?, IEnumerable<string>?, IEnumerable<string>?)
Initializes a new instance of the ValueSetValidator class.
Declaration
public ValueSetValidator(IEnumerable<string>? includeItemTypes, IEnumerable<string>? excludeItemTypes, IEnumerable<string>? includeFields, IEnumerable<string>? excludeFields)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | includeItemTypes | Item types to include during validation. |
| IEnumerable<string> | excludeItemTypes | Item types to exclude from validation. |
| IEnumerable<string> | includeFields | Fields to include during validation. |
| IEnumerable<string> | excludeFields | Fields to exclude from validation. |
Properties
View SourceExcludeFields
Optional exclusion list of index fields
Declaration
public IEnumerable<string>? ExcludeFields { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Remarks
If specified, all fields matching these field names will be filtered from the Examine.ValueSet
ExcludeItemTypes
Optional exclusion list of content types to ignore
Declaration
public IEnumerable<string>? ExcludeItemTypes { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Remarks
Any content type alias matched in this will not be included in the index
IncludeFields
Optional inclusion list of index fields to index
Declaration
public IEnumerable<string>? IncludeFields { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Remarks
If specified, all other fields in a Examine.ValueSet will be filtered
IncludeItemTypes
Optional inclusion list of content types to index
Declaration
public IEnumerable<string>? IncludeItemTypes { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Remarks
All other types will be ignored if they do not match this list
ValidIndexCategories
Declaration
protected virtual IEnumerable<string>? ValidIndexCategories { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Methods
View SourceValidate(ValueSet)
Validates the specified Examine.ValueSet against the configured inclusion and exclusion rules for categories, item types, and fields.
Declaration
public virtual ValueSetValidationResult Validate(ValueSet valueSet)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueSet | valueSet | The Examine.ValueSet to validate and filter. |
Returns
| Type | Description |
|---|---|
| ValueSetValidationResult | A Examine.ValueSetValidationResult indicating whether the value set is valid for indexing, and containing a filtered Examine.ValueSet with only the allowed fields if valid. If the value set does not meet the validation criteria, the result will indicate failure and contain the original value set. |