Search Results for

    Show / Hide Table of Contents
    View Source

    Class UmbracoFieldDefinitionCollection

    Custom Examine.FieldDefinitionCollection allowing dynamic creation of Examine.FieldDefinition

    Inheritance
    object
    ReadOnlyFieldDefinitionCollection
    FieldDefinitionCollection
    Namespace: Umbraco.Cms.Infrastructure.Examine
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class UmbracoFieldDefinitionCollection : FieldDefinitionCollection

    Constructors

    View Source

    UmbracoFieldDefinitionCollection()

    Initializes a new instance of the UmbracoFieldDefinitionCollection class containing the default Umbraco field definitions.

    Declaration
    public UmbracoFieldDefinitionCollection()
    View Source

    UmbracoFieldDefinitionCollection(FieldDefinitionCollection)

    Initializes a new instance of the UmbracoFieldDefinitionCollection class containing the containing the default Umbraco field definitions, augmented or overridden by the provided definitions.

    Declaration
    public UmbracoFieldDefinitionCollection(FieldDefinitionCollection definitions)
    Parameters
    Type Name Description
    FieldDefinitionCollection definitions

    Existing collection of field definitions.

    Fields

    View Source

    UmbracoIndexFieldDefinitions

    A type that defines the type of index for each Umbraco field (non user defined fields) Alot of standard umbraco fields shouldn't be tokenized or even indexed, just stored into lucene for retreival after searching.

    Declaration
    public static readonly FieldDefinition[] UmbracoIndexFieldDefinitions
    Field Value
    Type Description
    FieldDefinition[]

    Methods

    View Source

    TryGetValue(string, out FieldDefinition)

    Overridden to dynamically add field definitions for culture variations

    Declaration
    public override bool TryGetValue(string fieldName, out FieldDefinition fieldDefinition)
    Parameters
    Type Name Description
    string fieldName
    FieldDefinition fieldDefinition
    Returns
    Type Description
    bool
    Remarks

    We need to do this so that we don't have to maintain a huge static list of all field names and their definitions otherwise we'd have to dynamically add/remove definitions anytime languages are added/removed, etc... For example, we have things like nodeName and __Published which are also used for culture fields like nodeName_en-us and we don't want to have a full static list of all of these definitions when we can just define the one definition and then dynamically apply that to culture specific fields. There is a caveat to this however, when a field definition is found for a non-culture field we will create and store a new field definition for that culture so that the next time it needs to be looked up and used we are not allocating more objects. This does mean however that if a language is deleted, the field definitions for that language will still exist in memory. This isn't going to cause any problems and the mem will be cleared on next site restart but it's worth pointing out.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX