Class UmbracoFieldDefinitionCollection
Custom
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Examine
Assembly: cs.temp.dll.dll
Syntax
public class UmbracoFieldDefinitionCollection : FieldDefinitionCollection
Constructors
UmbracoFieldDefinitionCollection()
Declaration
public UmbracoFieldDefinitionCollection()
Fields
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 |
---|---|
Field |
Methods
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 |
---|---|---|
System. |
fieldName | |
Field |
fieldDefinition |
Returns
Type | Description |
---|---|
System. |
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.