Class UmbracoExamineIndex
An abstract provider containing the basic functionality to be able to query against Umbraco data.
Inheritance
Namespace: Umbraco.Cms.Infrastructure.Examine
Assembly: Umbraco.Examine.Lucene.dll
Syntax
public abstract class UmbracoExamineIndex : LuceneIndex, IUmbracoIndex, IIndex, IIndexDiagnostics, IIndexStats
Constructors
View SourceUmbracoExamineIndex(ILoggerFactory, string, IOptionsMonitor<LuceneDirectoryIndexOptions>, IHostingEnvironment, IRuntimeState)
Declaration
protected UmbracoExamineIndex(ILoggerFactory loggerFactory, string name, IOptionsMonitor<LuceneDirectoryIndexOptions> indexOptions, IHostingEnvironment hostingEnvironment, IRuntimeState runtimeState)
Parameters
| Type | Name | Description |
|---|---|---|
| ILoggerFactory | loggerFactory | |
| string | name | |
| IOptionsMonitor<LuceneDirectoryIndexOptions> | indexOptions | |
| IHostingEnvironment | hostingEnvironment | |
| IRuntimeState | runtimeState |
Properties
View SourceApplySpecialValueTransformations
Performs special __Path and __Icon value transformations to all deriving indexes when set to true.
Declaration
protected virtual bool ApplySpecialValueTransformations { get; }
Property Value
| Type | Description |
|---|---|
| bool |
EnableDefaultEventHandler
When set to true Umbraco will keep the index in sync with Umbraco data automatically
Declaration
public bool EnableDefaultEventHandler { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Metadata
A key/value collection of diagnostic properties for the index
Declaration
public virtual IReadOnlyDictionary<string, object?> Metadata { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> |
Remarks
Used to display in the UI
PublishedValuesOnly
When set to true the index will only retain published values
Declaration
public bool PublishedValuesOnly { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Any non-published values will not be put or kept in the index:
- Deleted, Trashed, non-published Content items
- non-published Variants
SupportProtectedContent
Whether the index can contain protected content
Declaration
public bool SupportProtectedContent { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
To retain backwards compatability, the default value is true
UniqueKeyFieldName
The name of the index field that contains the unique entity key (GUID). Used by the backoffice Examine dashboard to construct edit links for search results.
Declaration
public virtual string UniqueKeyFieldName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceCanInitialize()
Returns true if the Umbraco application is in a state that we can initialize the examine indexes
Declaration
protected bool CanInitialize()
Returns
| Type | Description |
|---|---|
| bool |
IsHealthy()
If the index can be open/read
Declaration
public Attempt<string?> IsHealthy()
Returns
| Type | Description |
|---|---|
| Attempt<string> | A successful attempt if it is healthy, else a failed attempt with a message if unhealthy |
OnDocumentWriting(DocumentWritingEventArgs)
This ensures that the special _Raw fields are indexed correctly
Declaration
protected override void OnDocumentWriting(DocumentWritingEventArgs docArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentWritingEventArgs | docArgs |
OnTransformingIndexValues(IndexingItemEventArgs)
Declaration
protected override void OnTransformingIndexValues(IndexingItemEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| IndexingItemEventArgs | e |
PerformDeleteFromIndex(IEnumerable<string>, Action<IndexOperationEventArgs>?)
override to check if we can actually initialize.
Declaration
protected override void PerformDeleteFromIndex(IEnumerable<string> itemIds, Action<IndexOperationEventArgs>? onComplete)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | itemIds | |
| Action<IndexOperationEventArgs> | onComplete |
Remarks
This check is required since the base examine lib will try to rebuild on startup
PerformIndexItems(IEnumerable<ValueSet>, Action<IndexOperationEventArgs>)
Declaration
protected override void PerformIndexItems(IEnumerable<ValueSet> values, Action<IndexOperationEventArgs> onComplete)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ValueSet> | values | |
| Action<IndexOperationEventArgs> | onComplete |